How to transform HTML to PDF in PHP
Hi guys,
I'm looking for a free PHP library that allow me to transform the simple HTML PDF ...
I saw that there are dozens online, but none that do their job very well...
I do not have big needs, I need something that has full support for tables and images, all here ...
some of you know and use successfully some library that might be for me?
Re: How to transform HTML to PDF in PHP
mPDF, it should work even with Charset other than UTF-8. Here a few examples:http://mpdf.bpm1.com/documentation/getting-started
If you've already seen html2fpdf, this is much better
mpdf> html2fpdf>> dompdf
Re: How to transform HTML to PDF in PHP
Really excellent, locally with apache it works perfectly, remotely with IIS I get the following error:
mPDF error: Could not include font metric file
Re: How to transform HTML to PDF in PHP
Both local and online have the same path (in the same folder, for example?)
If so, you should not define the path of the font folder on the file in which you are using mPDF:
PHP Code:
define ( 'FPDF_FONTPATH' , "mpdf/font/" );
For example, if you have the file that generates the PDF "documents / pdf.php" and mpdf is "mpdf / mpdf.php" write in "documents / pdf.php":
PHP Code:
define ( 'FPDF_FONTPATH' , "../mpdf/font/" );
Re: How to transform HTML to PDF in PHP
Quote:
Both local and online have the same path (in the same folder, for example?)
If so, you should not define the path of the font folder on the file in which you are using mPDF:
PHP Code:
define ( 'FPDF_FONTPATH' , "mpdf/font/" );
For example, if you have the file that generates the PDF "documents / pdf.php" and mpdf is "mpdf / mpdf.php" write in "documents / pdf.php":
PHP Code:
define ( 'FPDF_FONTPATH' , "../mpdf/font/" );
I was not able to resolve after several hours of research ...
in the end I opted for that dompdf works fine as it is and I do not think has anything to envy to mPDF seen the results ...
Thank you for ...