示例#1
0
 function __construct($orientation = 'P', $unit = 'mm', $format = 'A4', $encoding = 'UTF-8', $diskcache = FALSE)
 {
     if (TTi18n::getPDFDefaultFont() != 'freeserif' and $encoding == 'ISO-8859-1') {
         parent::__construct($orientation, $unit, $format, FALSE, 'ISO-8859-1', $diskcache);
         //Make sure TCPDF constructor is called with all the arguments
     } else {
         parent::__construct($orientation, $unit, $format, TRUE, $encoding, $diskcache);
         //Make sure TCPDF constructor is called with all the arguments
     }
     Debug::Text('PDF Encoding: ' . $encoding, __FILE__, __LINE__, __METHOD__, 10);
     /*
     if ( TTi18n::getPDFDefaultFont() == 'freeserif' ) {
     	Debug::Text('Using unicode PDF: Font: freeserif Unicode: '. (int)$unicode .' Encoding: '. $encoding, __FILE__, __LINE__, __METHOD__,10);
     } else {
     	//If we're only using English, default to faster non-unicode settings.
     	//unicode=FALSE and encoding='ISO-8859-1' is about 20-30% faster.
     	Debug::Text('Using non-unicode PDF: Font: helvetica Unicode: '. (int)$unicode .' Encoding: '. $encoding, __FILE__, __LINE__, __METHOD__,10);
     	parent::__construct($orientation, $unit, $format, FALSE, 'ISO-8859-1', $diskcache); //Make sure TCPDF constructor is called with all the arguments
     }
     */
     //Using freeserif font enabling font subsetting is slow and produces PDFs at least 1mb. Helvetica is fine though.
     $this->setFontSubsetting(TRUE);
     //When enabled, makes PDFs smaller, but severly slows down TCPDF if enabled. (+6 seconds per PDF)
     $this->SetCreator(APPLICATION_NAME . ' ' . getTTProductEditionName() . ' v' . APPLICATION_VERSION);
     return TRUE;
 }
示例#2
0
 /**
  * This is the class constructor. 
  * It allows to set up the page format, the orientation and 
  * the measure unit used in all the methods (except for the font sizes).
  * @param I2CE_Encoding $enc charset encoding for all input strings
  * @param string $orientation page orientation. Possible values are (case insensitive):<ul><li>P or Portrait (default)</li><li>L or Landscape</li></ul>
  * @param string $unit User measure unit. Possible values are:<ul><li>pt: point</li><li>mm: millimeter (default)</li><li>cm: centimeter</li><li>in: inch</li></ul><br />A point equals 1/72 of inch, that is to say about 0.35 mm (an inch being 2.54 cm). This is a very common unit in typography; font sizes are expressed in that unit.
  * @param mixed $format The format used for pages. It can be either one of the following values (case insensitive) or a custom format in the form of a two-element array containing the width and the height (expressed in the unit given by unit).<ul><li>4A0</li><li>2A0</li><li>A0</li><li>A1</li><li>A2</li><li>A3</li><li>A4 (default)</li><li>A5</li><li>A6</li><li>A7</li><li>A8</li><li>A9</li><li>A10</li><li>B0</li><li>B1</li><li>B2</li><li>B3</li><li>B4</li><li>B5</li><li>B6</li><li>B7</li><li>B8</li><li>B9</li><li>B10</li><li>C0</li><li>C1</li><li>C2</li><li>C3</li><li>C4</li><li>C5</li><li>C6</li><li>C7</li><li>C8</li><li>C9</li><li>C10</li><li>RA0</li><li>RA1</li><li>RA2</li><li>RA3</li><li>RA4</li><li>SRA0</li><li>SRA1</li><li>SRA2</li><li>SRA3</li><li>SRA4</li><li>LETTER</li><li>LEGAL</li><li>EXECUTIVE</li><li>FOLIO</li></ul>
  */
 public function __construct($encoding, $orientation = 'P', $unit = 'mm', $format = 'A4')
 {
     parent::__construct($orientation, $unit, $format, $encoding->useMB(), $encoding->getEncodingType());
     $this->enc = $encoding;
     $this->font_metrics = array();
     $fm = null;
     $hyphen = null;
     $this->text_table = new I2CE_TextTable($this->fwPt, $fm, $hyphen, $encoding);
     $this->SetLineSpacing(1);
 }
 /**
  * Constructeur de la classe label
  *
  *
  * @param integer $label_id		id de l'etiquette dans le fichier de configuration
  * @param integer $data			Tableau de données pour la réalisation du gabarit. Chaque entrée dans le tableau correspond à une étiquette (nombre d'étiquettes = count($data) ).
  * @param integer $pathConfig	Chemin vers le répertoire ou est situé le fichier de paramétrage label.xml (avec le "/" à la fin).
  * @param integer $configFile	Nom du fichier de paramétrage (Par défaut : "label.xml" )
  * @param integer $border		Affiche ou non les traits de séparation de chaque étiquette (peux servir au découpage papier) (Par défaut : false).
  */
 function __construct($label_id, $data, $pathConfig, $configFile, $border = false)
 {
     if ($configFile == '' || $configFile == NULL) {
         $this->configFile = $pathConfig . $this->configFile;
     } else {
         $this->configFile = $pathConfig . $configFile;
     }
     // Affectation d'un ID étiquette
     $this->loadLabelConfig($label_id);
     $this->data = $data;
     $this->border = $border;
     // Appel du constructeur parent TCPDF
     tcpdf::__construct($this->sheetOrientation, PDF_UNIT, $this->labelSheetFormat, true);
     $this->ctrlLabelConfig();
     // margin
     $this->SetMargins($this->labelMargin, $this->labelMargin);
     $this->SetCellPadding(0);
 }