/** * class constructor * * @access public * @param string $orientation page orientation, same as TCPDF * @param mixed $format The format used for pages, same as TCPDF * @param $tring $langue Lang : fr, en, it... * @param boolean $unicode TRUE means that the input text is unicode (default = true) * @param String $encoding charset encoding; default is UTF-8 * @param array $marges Default margins (left, top, right, bottom) * @param boolean $is_rtl True will set to use RTL(right to left) language. * @return HTML2PDF $this */ public function __construct($orientation = 'P', $format = 'A4', $langue = 'fr', $unicode = true, $encoding = 'UTF-8', $marges = array(5, 5, 5, 8), $is_rtl = false) { // init the page number $this->_page = 0; $this->_firstPage = true; // save the parameters $this->_orientation = $orientation; $this->_format = $format; $this->_langue = strtolower($langue); $this->_unicode = $unicode; $this->_encoding = $encoding; // load the Local HTML2PDF_locale::load($this->_langue); // create the HTML2PDF_myPdf object $this->pdf = new HTML2PDF_myPdf($orientation, 'mm', $format, $unicode, $encoding); // init the CSS parsing object $this->parsingCss = new HTML2PDF_parsingCss($this->pdf); $this->parsingCss->fontSet(); $this->_defList = array(); // init some tests $this->setTestTdInOnePage(true); $this->setTestIsImage(true); $this->setTestIsDeprecated(true); // init the default font $this->setDefaultFont(null); // init language direction setting if ($is_rtl) { $this->pdf->setRTL(true); } // init the HTML parsing object $this->parsingHtml = new HTML2PDF_parsingHtml($this->_encoding); $this->_subHtml = null; $this->_subPart = false; // init the marges of the page if (!is_array($marges)) { $marges = array($marges, $marges, $marges, $marges); } $this->_setDefaultMargins($marges[0], $marges[1], $marges[2], $marges[3]); $this->_setMargins(); $this->_marges = array(); // init the form's fields $this->_lstField = array(); return $this; }