Jump to content

[SOLVED] HTML in PDF, is it possible?


Madatan

Recommended Posts

Yes I have gotten that far myself, I create PDFs using PHP but so far I have only been able to create PDFs with normal text and images. If I for example use "<h1>Title</h1>" the PDF will display "<h1>Title</h1>". What i'm hoping to find is some class or function that possible could convert html into whatever PDF use.

 

I hope that was a better explanation :P

Link to comment
Share on other sites

The short answer is no, the long answer is yes. You can't do it directly. You would need a service to translate the HTML code into something that can be used for PDF creation - whether you are creating through PHP or even PostScript (the native language for PDF creation).

 

You could build your own interpreter, but it would be time consuming - consider the fact that not every browser renders a page exactly the same. There are plenty of free utilities that will already provide this capability, such as

 

http://html2pdf.seven49.net/Web/

http://www.activepdf.com/products/serverproducts/docconverter/overview.cfm

http://www.htm2pdf.co.uk/

http://www.digitaljunkies.ca/dompdf/

 

 

Link to comment
Share on other sites

The short answer is no, the long answer is yes. You can't do it directly. You would need a service to translate the HTML code into something that can be used for PDF creation - whether you are creating through PHP or even PostScript (the native language for PDF creation).

 

You could build your own interpreter, but it would be time consuming - consider the fact that not every browser renders a page exactly the same. There are plenty of free utilities that will already provide this capability, such as

 

http://html2pdf.seven49.net/Web/

http://www.activepdf.com/products/serverproducts/docconverter/overview.cfm

http://www.htm2pdf.co.uk/

http://www.digitaljunkies.ca/dompdf/

 

 

 

Thank you! I have found those myself and I was pretty sure there were no easy way to do it by myself, so thanks for confirming that! I guess I will have to use one of the free ones, just mod it a bit.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.