Forums Register Login

Displaying .pdf documents using swing

+Pie Number of slices to send: Send
Can I display a .pdf document in any Swing component ie a JEditorPane??? I need to display the .pdf document in a swing component to enable java printing for that document .
+Pie Number of slices to send: Send
JEditorPane does not support PDF at the moment. of course you could implement your own EditorKit for it (like HTMLEditorKit and RTFEditorKit). Might not be that easy, though.
Another way would be to use the acrobat reader plugin if it is possible to start a web plugin inside the java virtual machine. Or to start the acrobat reader using Runtime.exec().
If you are only interested in the contents of the pdf and don't care much on shwoing the layout, there are open source pdf parsers that allow you to extract and modify the contents (and even the layout). See iText (http://www.lowagie.com/iText/).
chantal
+Pie Number of slices to send: Send
I was generating pdf reports from the database .So I guess I will generate the reports in HTML and display the same in a JEditorPane for printing .Thanks a lot Chantal.U saved me considerable amount of effort .
[ July 12, 2002: Message edited by: Anamika Singh ]
It's a tiny ad only because the water is so cold.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 2274 times.
Similar Threads
Design issue - resources handling
Displaying document contents
open acrobat reader in swing component
I have passed SCEA with 85%
Reading PDF Files from a Java program
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 10:39:37.