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

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/

 

 

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.