PHP/HTML to PDF Conversion

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
diseman
Forum Contributor
Posts: 174
Joined: Mon Jul 26, 2010 1:30 pm
Location: Florida

PHP/HTML to PDF Conversion

Post by diseman »

Hi All,

New programmer here really stuck on converting HTML to PDF. I've installed almost every converter I can find, but constantly run into deprecation errors or other warnings about the code. I particularly liked HTML2FPDF as it was easy to install and work. However, deprecation and other errors out the ying-yang with PHP 5.3.

Anyone have any suggestions for a simple and small foot-print script that works with PHP and will let me create a PDF based on dynamic data that WORKS WITH PHP 5.3?

By the way, HTML2FPDF had 'magic_quotes' in it that was causing all the deprecation errors in 5.3. After I silenced them.. there were more errors.

I don't get it... 5.3 has been out for a while, but I don't see anything on the Internet for a fix, which is weird. Am I doing something wrong as a beginner/noob?

Thanks in advance...
windsortommy
Forum Newbie
Posts: 2
Joined: Mon Sep 13, 2010 12:03 pm

Re: PHP/HTML to PDF Conversion

Post by windsortommy »

Hi,
It seems to me that under php5.3 html2pdf is working.
I tried the example on the www.http://html2pdf.fr/en/download and works!
Keep me posted after you tried.

:)
User avatar
diseman
Forum Contributor
Posts: 174
Joined: Mon Jul 26, 2010 1:30 pm
Location: Florida

Re: PHP/HTML to PDF Conversion

Post by diseman »

I tried DOMPDF and had problems, but I'm going to try again and post here.

The HTML2PDF I've not seen before and will give a try shortly. I'll report back here immediately after.

thank you both.
User avatar
diseman
Forum Contributor
Posts: 174
Joined: Mon Jul 26, 2010 1:30 pm
Location: Florida

Re: PHP/HTML to PDF Conversion

Post by diseman »

OK, so after working on another learning project I'm back and looking to overcome this HTML to PDF hurdle again.

Let me start this time by explaining what I'm trying to do and what I'm looking for.

I simply want to take data from a MySQL db and put it into several HTML pages and then have it converted to one PDF document in the background and then e-mail it to myself. The e-mail piece is a separate issue.

I prefer NOT TO put the HTML inside the <?php...;?> because that just makes it more complicated. I'd rather just make separate HTML pages for this purpose and then have the HTML to PDF application convert convert them and make one document out of them all.

I don't want anything commercial that has a price. This is just for me to learn.

I prefer something with a small footprint.

* Must work with PHP 5.3 (i.e. No deprecation errors) I'm using WAMP and it comes with PHP 5.3.

I realize not all converters out there will meet all the requirements, but I'm interested in knowing what you recommend.
Post Reply