Exemple #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;
 }
 function getTTProductEdition($name = FALSE)
 {
     if ($name == TRUE) {
         $edition = getTTProductEditionName();
     } else {
         $edition = getTTProductEdition();
     }
     Debug::text('Edition: ' . $edition, __FILE__, __LINE__, __METHOD__, 10);
     return $edition;
 }