Forums Register Login

how to convert servlet output into pdf

+Pie Number of slices to send: Send
how to convert servlet output into (pdf) pl z if possible give me sample code of servlet and steps also... its argent
[ December 26, 2008: Message edited by: Bear Bibeault ]
+Pie Number of slices to send: Send
Hi Ravi,

Do you mean the out.println part ? If yes then you can do this by setting the response type setting as like Response.ContentType="application/pdf"

Cheers!!!

Ujjwal B Soni

<ujjwalbsoni20032003@yahoo.com>
<919998971048>
+Pie Number of slices to send: Send
no not only sending part I am not getting external settings also.....
ok i sented response type text/pdf but what about next... please give me complete. details... and sample code if possible also... thank you
+Pie Number of slices to send: Send
 

Originally posted by Ravii Bhai:
please give me complete. details... and sample code if possible also...



you can get sample code in Google .
+Pie Number of slices to send: Send
then give me the link of google. if you know or give me some usefully site address
+Pie Number of slices to send: Send
What format is the "servlet output" in? If it's XHTML, you may be able to use the "flying saucer" library (somewhere on dev.java.net). If it's something else, tell us the details. Either way, much more work is going to be involved than setting the response type to PDF.
+Pie Number of slices to send: Send
"argent"? I assume you meant "urgent". In any case, please read this for information on why that's not a good idea.
+Pie Number of slices to send: Send
 

Originally posted by Ravii Bhai:
then give me the link of google.


The literal answer to this is www.google.com. I don't think that's what you meant to ask.

iText creates PDF output if you have the data in Java and want to render it directly in PDF.
+Pie Number of slices to send: Send
Hi Ravii,

The iText library (homepage http://www.lowagie.com/iText/) is a great library for generating PDFs via Java.

An example of using iText to generate a PDF file can be found at http://www.avajava.com/tutorials/lessons/how-do-i-write-to-a-pdf-file-using-itext.html.

An example of serving up a PDF file from a servlet can be found at http://www.avajava.com/tutorials/lessons/how-do-i-serve-up-a-pdf-from-a-servlet.html.

If you want to generate PDF content to be served up directly through a servlet with no intermediary file in the file system, this can usually be accomplished by writing the generated PDF content to the output stream of the servlet directly rather than writing to a file output stream. Elliotte Rusty Harold's Java I/O book is a great resource for understanding streams.

Hope that helps,
Edwin
Beauty is in the eye of the tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 4872 times.
Similar Threads
Open PDF file in IE by using Java
How to convert doc files to pdf in Struts2
how to convert jsp output into pdf argent..........
JSP to Servlet
PDF through JSP
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 09:26:33.