コード例 #1
0
 /**
  * Constructeur
  *
  * @param	string		sens portrait ou landscape
  * @param	string		format A4, A5, ...
  * @param	string		langue : 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 par defaut, dans l'ordre (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))
 {
     // sauvegarde des paramètres
     $this->page = 0;
     $this->sens = $sens;
     $this->format = $format;
     $this->unicode = $unicode;
     $this->encoding = $encoding;
     $this->firstPage = true;
     $this->langue = strtolower($langue);
     // chargement du fichier de langue
     HTML2PDF::textLOAD($this->langue);
     // création de l' objet PDF
     $this->pdf = new MyPDF($sens, 'mm', $format, $unicode, $encoding);
     // initialisation des styles
     $this->style = new styleHTML($this->pdf);
     $this->style->FontSet();
     $this->defLIST = array();
     // initialisations diverses
     $this->setTestTdInOnePage(true);
     $this->setTestIsImage(true);
     $this->setTestIsDeprecated(true);
     $this->setDefaultFont(null);
     // initialisation du parsing
     $this->parsing = new parsingHTML($this->encoding);
     $this->sub_html = null;
     $this->sub_part = false;
     // initialisation des marges
     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();
     // initialisation des champs de formulaire
     $this->lstChamps = array();
 }