Html2pdf V4 is now written entirely in PHP5 and uses TCPDF instead of FPDF.
IMPORTANT: Html2pdf has changed, and how to handle errors. Look at the examples.
Below is the Constructor for the HTML2PDF Class :
/** * Constructeur * * @param string $sens - landscape or portrait orientation * @param string $format - format A4, A5, ... * @param string $langue - language: fr, en, it ... * @param boolean $unicode - TRUE means clustering the input text IS unicode (default = true) * @param String $encoding - charset encoding; Default is UTF-8 * @param array $marges - margins by default, in order (left, top, right, bottom) * @return null */ public function __construct($sens = 'P', $format = 'A4', $langue='en', $unicode=true, $encoding='UTF-8', $marges = array(5, 5, 5, 8))
A very simple example of use :
require_once('/home/username/html2pdf/html2pdf.class.php'); $html2pdf = new HTML2PDF('P', 'A4', 'en'); $html2pdf->writeHTML('<p>This is your first PDF File</p>'); $html2pdf->Output('first_PDF_file.pdf');
Author, Title, Subject and Keywords
PDF Display Mode (i.e. 'fullpage')