This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes How to save a webpage as PDF ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "How to save a webpage as PDF ?" Watch "How to save a webpage as PDF ?" New topic

How to save a webpage as PDF ?

Anoop Nair
Ranch Hand

Joined: Oct 29, 2008
Posts: 70
Hi All,

I have a webpage in which there is a "Save" button, which is supposed to save the entire page in PDF format.
The webpage has images, text and also CSS.

I tried using flying saucer and iText. However when using this, the background images (done via CSS) are not coming in the PDF file.

Below is the code I am using. Is there a better way to do this where the entire page can directly be converted to PDF format.

I agree. Here's the link:
subject: How to save a webpage as PDF ?
jQuery in Action, 3rd edition