HTML Table to PDF conversion using PHP

I'd like to convert an html table into a pdf file using php. I don't want to
install or keep the library in the www folder.

3,325 1 1 gold badge 40 40 silver badges 57 57 bronze badges asked Nov 29, 2013 at 10:32 johncy binoy johncy binoy 53 2 2 gold badges 3 3 silver badges 9 9 bronze badges Commented Nov 29, 2013 at 10:34

2 Answers 2

I am using the mPDF library. Here you have some examples and documentation.It is really great. It works with Look an example:

 require_once (dirname(__FILE__) . '/../pdf/mpdf.php'); /*this is the constructor with different options : mPDF([ string $mode [, mixed $format [, *float $default_font_size [, string $default_font [, float $margin_left , float $margin_right , *float $margin_top , float $margin_bottom , float $margin_header , float $margin_footer [, *string $orientation ]]]]]])*/ $mpdf = new mPDF('win-1252', 'A4', '', '', 10, '', '', '', '', ''); $mpdf -> useOnlyCoreFonts = true; $mpdf -> SetDisplayMode('fullpage'); $mpdf -> WriteHTML("

here you put the html

"); $mpdf -> Output();// this generates the pdf exit;