Concatenate PDF documents using servlets 2007-12-03 - By Bruno Lowagie
Back Bellamkonda, Ramesh (IE10) wrote: > Hi > > I am new to iText, How can we Concatenate PDF documents using > servlets.Please give me a example. I am able to do the same thing in a > stand alone application.
If you can do it in a standalone example, you can do it in a Servlet. Just write the PDF to a ByteArrayOutputStream instead of to a FileOutputStream. Consult the tutorial for inspiration: http://itextdocs.lowagie.com/tutorial/general/webapp/
Once you have the ByteArrayOutputStream baos, you'll need to do something like this;
response.setContentType("application/pdf"); response.setContentLength(baos.size()); ServletOutputStream out = response.getOutputStream(); baos.writeTo(out); out.flush();
Please read the complete tutorial chapter to find out more about some common pitfalls. br, Bruno
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----- SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 __ ____ ____ ____ ____ ____ ____ ____ ____ ____ iText-questions mailing list iText-questions@(protected) https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
|
|