Hi All:
I know that my browser can
display PDF propertly now, however the following
piece of code (that generates PDF data) sends the
data back to the client
(IE6) and still does not not looks like PDF
at all. Can someone please tell me
if there is something wrong with this code.
By the way
(out = response.getOutputStream() and "foFile"
comes from an "FO" file).
public void renderFO(InputSource
foFile, HttpServletResponse response)
throws IOException { try { ByteArrayOutputStream outPDF = new ByteArrayOutputStream(); response.setContentType("application/pdf"); Driver driver = new Driver(foFile, outPDF); driver.setRenderer(Driver.RENDER_PDF); driver.setOutputStream(outPDF); driver.run(); byte[] content =
outPDF.toByteArray();
response.setContentLength(content.length); out.write(content); out.flush(); } catch (Exception ex) { System.out.println(ex); } Thanks,
Carmelo Montanez
Carmelo Montanez
NIST Stop 8970 Gaithersburg, MD 20899 |
- Re: Anything wrong with this code> Carmelo Montanez
- Re: Anything wrong with this code> Semprini Davide
- Re: Anything wrong with this code> Carmelo Montanez
- Re: Anything wrong with this code> Semprini Davide