IntelliJ Java IDE
The moose likes I/O and Streams and the fly likes Convetor html to xml and html to pdf Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Reply Bookmark "Convetor html to xml and html to pdf" Watch "Convetor html to xml and html to pdf" New topic
Author

Convetor html to xml and html to pdf

Satyajeet Kadam
Ranch Hand

Joined: Oct 19, 2006
Posts: 202
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

Joined: Jan 03, 2004
Posts: 3133
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
Rancher

Joined: Sep 21, 2011
Posts: 2329
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

Joined: Feb 13, 2012
Posts: 3
Use this html to pdf converter to create your own service to call from application. Hope it helps.
 
 
subject: Convetor html to xml and html to pdf
 
Threads others viewed
Creating PDF documents
PDF from a servlet!
Jsp to pdf
how to save a webpage with struts code as pdf in java?
how to save a jsp page as pdf in java?
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com