Madatan Posted November 25, 2008 Share Posted November 25, 2008 As topic states, is it possible to get information from a database with html-tags stored in the table and build a PDF with H1, br, p, tables etc etc? Quote Link to comment Share on other sites More sharing options...
br3nn4n Posted November 25, 2008 Share Posted November 25, 2008 I know I've read somewhere that you can create pdfs with PHP. So you can do at least that. Cs far as putting html in that pdf, I hasten to say I think it would support it. I just can't remember if pdfs support it. Quote Link to comment Share on other sites More sharing options...
Madatan Posted November 25, 2008 Author Share Posted November 25, 2008 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 Quote Link to comment Share on other sites More sharing options...
Psycho Posted November 25, 2008 Share Posted November 25, 2008 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/ Quote Link to comment Share on other sites More sharing options...
Madatan Posted November 25, 2008 Author Share Posted November 25, 2008 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.