• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Displaying .pdf documents using swing

 
Ranch Hand
Posts: 67
IBM DB2 Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 .
 
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Anamika Singh
Ranch Hand
Posts: 67
IBM DB2 Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
straws are for suckers. tiny ads are for attractive people.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic