This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Other JSE/JEE APIs and the fly likes converting html to pdf Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Reply Bookmark "converting html to pdf" Watch "converting html to pdf" New topic
Author

converting html to pdf

Naresh Chaurasia
Ranch Hand

Joined: May 18, 2005
Posts: 309
I have an assignment to convert html to pdf. The html file may contain images, heading, text, tables etc. The output pdf file should look like the original pdf.

I have googled and found out some links. While i am investigating those links, can some one suggest what would be good APIs that would help me to do this conversion.

Any help will be appreciated.


SCJP 1.4, SCWCD1.4, OCA(1Z0-007)
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35241
    
    7
If it's CSS-styled XHTML, then the FlyingSaucer library can do this.

You could also try OpenOffice's Java API (I think OO can open HTML files), or a library like JODCOnverter that uses OO in server mode.


Android appsImageJ pluginsJava web charts
Naresh Chaurasia
Ranch Hand

Joined: May 18, 2005
Posts: 309
Hi Ulf,
Thanks for your quick responses. I have been able to generate PFDs from HTML using FlyingSaucer. The PDFs generate are pretty neat.
Naresh Chaurasia
Ranch Hand

Joined: May 18, 2005
Posts: 309
Hi Ulf,
I am trying to do pdf generation from html, but only first page of pdf is generated. The entire html is not converted to pdf. Let me know what should be done to rectify the problem. I spent time looking at the code but cannot find any clue.

HTML



CSS



 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: converting html to pdf
 
Similar Threads
PDF and HTML
HTML to PDF Conversion using Java
PDF file and JSP
Converting HTML to PDF and merging PDFs using Java
Printing Report in Struts2