Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Convetor html to xml and html to pdf  RSS feed

 
Satyajeet Kadam
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to convert an html file to pdf file without changing the format of intenal data in html file.I don't what will be format of the data in html data or what data it will contain.How can i do this?

Q1 )will Itext jar will help me in this?
Q2) Is this possiable to read the bytes from html file and copy into another file and change its format to PDF ?


 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't just read bytes and port them straight over. You need 3 pieces:

1) A piece that can parse HTML and understand the semantics of each of its semantic elements.

2) A piece that understands the semantics of PDF's layout elements and can write them out.

3) A piece to convert from #1 to #2.
 
Tim Moores
Saloon Keeper
Posts: 3512
77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the HTML happens to be CSS-styled XHTML, then the FlyingSaucer library can do this.

If it's not , then iText can help you with #2 in Jeff's list.
 
Soft Eval
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use this html to pdf converter to create your own service to call from application. Hope it helps.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!