Hi all,I want to generate a pdf file dynamically, based on the html page....

Means,Html page is generated from the user submitting the details, based on the details, dynamically i generated one html file contains 3 images, now i want this final html page as pdf format..

I tried some tools by giving the URL of that page, but it is generating only the text part, but not the images... and also i have submit buttons in that html page, i don't want that in the generated pdf...

Can you give me any regarding this problem, in a better and simple way...

Hi all,I want to generate a pdf file dynamically, based on the html page....

Means,Html page is generated from the user submitting the details, based on the details, dynamically i generated one html file contains 3 images, now i want this final html page as pdf format..

I tried some tools by giving the URL of that page, but it is generating only the text part, but not the images... and also i have submit buttons in that html page, i don't want that in the generated pdf...

Can you give me any regarding this problem, in a better and simple way...

Thanking you..

You'll find there are many PDF libraries out there that claim to handle HTML to PDF document conversion, but the vast majority of these only partially support CSS and HTML.

What you'll generally end up with is a PDF document with all the unsupported elements missing. If the HTML is within your control, you may be able to work around some of these issues.

If you need to reproduce high quality PDF documents from arbitrary web pages, the good news is it is possible, but your choice may be limited to commercially developed libraries and may also depend on your server platform.

I can't recommend one product or another (forum rules! :x), but what I'd like to suggest is this:

Find an online service that can handle the type of pages you want to convert, on the platform that you will be using. Download their output and examine the contents of the file in a text editor. You might be able to identify the PDF component used in the file header.

BTW, if the file's contents appear gibberish, you may need to decode it first.

EastCoast
—
2011-03-18T10:11:20Z —
#5

AffineMesh94464 said:

You'll find there are many PDF libraries out there that claim to handle HTML to PDF document conversion, but the vast majority of these only partially support CSS and HTML.

This is why wkhtmltopdf is so good - it's a full webkit engine so you get full css and html support. It's also massively faster than the pure php solutions around. The down side is you can only use it if you have sufficient access on your hosting to install or execute applications.

AffineMesh94464
—
2011-04-13T03:47:34Z —
#6

The choice of rendering engine will certainly affect the appearance of HTML when converted to PDF, so it's a point worth considering.

Webkit is fine, as used in Chrome and Safari. But you probably wouldn't want to select this if your user base was heavily dependent on another browser.

This is sometimes the case in corporate environments, where users choice of browser can be limited. South Korea is another example, where the vast majority of Internet users are obliged to use Internet Explorer (90%?).