Tuesday 15 June 2010

pdf generation - Open PDF file download without store in drive -



pdf generation - Open PDF file download without store in drive -

my requirement forcefulness scheme open pdf file without storing in server or client system. using java, jsf, itext. i've not succeeded far. help?

this question has been answered day ago here: how convert pdfstamper byte array

i didn't mark question duplicate, because question , question may seem different @ first sight, reply both questions identical:

see instance formservlet illustration says:

// create outputstream new pdf bytearrayoutputstream baos = new bytearrayoutputstream(); // create pdf pdfstamper stamper = new pdfstamper(reader, baos);

then later in example, this:

// write pdf bytes outputstream outputstream os = response.getoutputstream(); baos.writeto(os);

as can see: not store pdf using fileoutputstream (no file stored on server), store file in memory using bytearrayoutputstream. write bytes outputstream of response object.

this illustration taken book contains jsp example: http://itextpdf.com:8180/book/helloworld.jsp

however, book lists substantial number of reasons why it's bad thought utilize jsp create pdf. jsp developer, know jsp should never used create files in binary format. pdfs binary files, hence: should write servlet create pdf, not jsp file.

pdf pdf-generation itext

No comments:

Post a Comment