Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 06-02-2009
Member
 
Join Date: Feb 2009
Posts: 90
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?
Reply With Quote
  #2  
Old 06-02-2009
Member
 
Join Date: Oct 2008
Posts: 167
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
Reply With Quote
  #3  
Old 06-02-2009
Member
 
Join Date: Feb 2009
Posts: 90
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
Reply With Quote
  #4  
Old 06-02-2009
Member
 
Join Date: Dec 2008
Posts: 161
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/" ); 
Reply With Quote
  #5  
Old 06-02-2009
Member
 
Join Date: Feb 2009
Posts: 90
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 ...
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to transform HTML to PDF in PHP"
Thread Thread Starter Forum Replies Last Post
Should I get The Samsung Transform Ultra or not? TeesMaar Portable Devices 3 04-12-2011 06:55 PM
HTC EVO vs Samsung Transform Harry-Puttar Portable Devices 6 20-02-2011 09:06 PM
Help me to use the transform() in C++ coding Tailor Software Development 5 19-02-2010 04:17 PM
How to define HTML Validator and services provided by HTML Validator Aldous Software Development 3 22-09-2009 01:12 PM
How to transform a VHS tape to DVD? Ashton Windows Software 3 27-08-2008 05:47 PM


All times are GMT +5.5. The time now is 07:45 PM.