Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to convert xml to pdf form in java

 
vipin jain
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
vipin jain
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
vipin jain wrote:


Hi any one please tell me how to convert xml in pdf and visa versa ?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "xml-to-pdf" part can be achieved using the Apache FOP library if you're proficient in XSL-FO. If the XML is closer to XHTML, the Flying Saucer library may help (it's on dev.java.net).

The "vice versa" part will be hard, if not impossible. You may be able to extract the text that's in the pdf using a librariy like PDFBox or JPedal, but that text will be unstructured. So it'd be up to your application to create XML from that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic