Example #1
1
 function __construct($size = 'letter')
 {
     parent::__construct('P', 'mm', $size, true, 'UTF-8', false, false);
     $this->SetMargins(PAGE_MARGIN, PAGE_MARGIN, PAGE_MARGIN);
     $this->SetTopMargin(75);
     $this->SetAutoPageBreak(TRUE, 90);
 }
Example #2
0
 function __construct($options = array())
 {
     $default = array('orientation' => PDF_PAGE_ORIENTATION, 'unit' => PDF_UNIT, 'format' => PDF_PAGE_FORMAT, 'unicode' => true, 'encoding' => 'UTF-8');
     $options = array_merge($default, $options);
     extract($options);
     parent::__construct($orientation, $unit, $format, $unicode, $encoding, false);
 }
 function PDF()
 {
     global $Prefs;
     define('RowSpace', 2);
     // define separation between the heading rows
     $PaperSize = explode(':', $Prefs['papersize']);
     if (PDF_APP == 'FPDF') {
         $this->FPDF($Prefs['paperorientation'], 'mm', $PaperSize[0]);
     } else {
         parent::__construct($Prefs['paperorientation'], 'mm', $PaperSize[0], true, 'UTF-8', false);
         $this->SetCellPadding(0);
     }
     if ($Prefs['paperorientation'] == 'P') {
         // Portrait - calculate max page height
         $this->pageY = $PaperSize[2] - $Prefs['marginbottom'];
     } else {
         // Landscape
         $this->pageY = $PaperSize[1] - $Prefs['marginbottom'];
     }
     $this->SetMargins($Prefs['marginleft'], $Prefs['margintop'], $Prefs['marginright']);
     $this->SetAutoPageBreak(0, $Prefs['marginbottom']);
     $this->SetFont(PDF_DEFAULT_FONT);
     $this->SetDrawColor(128, 0, 0);
     $this->SetLineWidth(0.35);
     // 1 point
     $this->AliasNbPages();
 }
Example #4
0
 function __construct()
 {
     global $report;
     $PaperSize = explode(':', $report->page->size);
     if (PDF_APP == 'TCPDF') {
         parent::__construct($report->page->orientation, 'mm', $PaperSize[0], true, 'UTF-8', false);
         $this->SetCellPadding(0);
     } else {
         $this->FPDF($report->page->orientation, 'mm', $PaperSize[0]);
     }
     if ($report->page->orientation == 'P') {
         // Portrait - calculate max page height
         $this->pageY = $PaperSize[2] - $report->page->margin->bottom;
     } else {
         // Landscape
         $this->pageY = $PaperSize[1] - $report->page->margin->bottom;
     }
     $this->SetMargins($report->page->margin->left, $report->page->margin->top, $report->page->margin->right);
     $this->SetAutoPageBreak(0, $report->page->margin->bottom);
     $this->SetFont(PDF_DEFAULT_FONT);
     $this->SetDrawColor(128, 0, 0);
     $this->SetLineWidth(0.35);
     // 1 point
     //	  $this->AliasNbPages(); // deprecated
 }
Example #5
0
 /**
  * __construct
  *
  * @param array $options Array of options.
  *
  * @return void
  */
 public function __construct($options)
 {
     $this->options(array_merge($this->_defaultOptions, $options));
     $options = $this->options();
     parent::__construct($options['orientation'], $options['unit'], $options['format'], $options['unicode'], $options['encoding'], $options['diskcache']);
     mb_internal_encoding('UTF-8');
     $this->SetCreator($options['creator']);
     $this->SetAuthor($options['author']);
     $this->SetTitle($options['title']);
     $this->SetSubject($options['subject']);
     $this->SetKeywords($options['keywords']);
     // lang
     $this->setLanguageArray($options['language']);
     //set auto page breaks
     $this->SetAutoPageBreak(true, $options['footer']['margin']);
     // set font
     $this->SetFont($options['font'], '', $options['font_size']);
     $this->SetCellPadding(2);
     // margins
     $this->SetMargins($options['margin']['left'], $options['margin']['top'], $options['margin']['right'], true);
     if (empty($options['header'])) {
         $this->SetPrintHeader(false);
     } else {
         $this->SetHeaderMargin($options['header']['margin']);
     }
     if (empty($options['footer'])) {
         $this->SetPrintFooter(false);
     } else {
         $this->SetFooterMargin($options['footer']['margin']);
     }
 }
Example #6
0
 /**
  * Initialize 
  *
  */
 function __construct($params = array())
 {
     $orientation = 'P';
     $unit = 'mm';
     $format = 'A4';
     $unicode = true;
     $encoding = 'UTF-8';
     $diskcache = false;
     if (isset($params['orientation'])) {
         $orientation = $params['orientation'];
     }
     if (isset($params['unit'])) {
         $unit = $params['unit'];
     }
     if (isset($params['format'])) {
         $format = $params['format'];
     }
     if (isset($params['encoding'])) {
         $encoding = $params['encoding'];
     }
     if (isset($params['diskcache'])) {
         $diskcache = $params['diskcache'];
     }
     # initialize TCPDF
     parent::__construct($orientation, $unit, $format, $unicode, $encoding, $diskcache);
 }
Example #7
0
 public function __construct($orientation = 'P', $format = "Letter", $color = 'gray')
 {
     parent::__construct($orientation, "pt", $format);
     self::$document_orientation = $orientation;
     self::$document_format = $format;
     $margins = parent::getMargins();
     $this->document_width = parent::getPageWidth() - $margins['left'] - $margins['right'];
     $this->last_width = $margins['left'];
     $this->last_height = $margins['top'];
     $this->document_color = $color;
     if ($color == 'red') {
         parent::SetDrawColorArray(array(255, 128, 128));
     } elseif ($color == 'green') {
         parent::SetDrawColorArray(array(128, 255, 128));
     } elseif ($color == 'blue') {
         parent::SetDrawColorArray(array(128, 128, 255));
     } else {
         parent::SetDrawColorArray(array(128, 128, 128));
     }
     parent::SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     parent::SetAutoPageBreak(true, PDF_MARGIN_BOTTOM);
     parent::setImageScale(PDF_IMAGE_SCALE_RATIO);
     parent::SetHeaderMargin(PDF_MARGIN_HEADER);
     parent::SetFooterMargin(PDF_MARGIN_FOOTER + 10);
 }
Example #8
0
 /**
 	Constructor
 */
 function __construct($orientation = 'P', $unit = 'in', $format = 'LETTER', $unicode = true, $encoding = 'utf-8', $diskcache = false, $pdfa = false)
 {
     parent::__construct($orientation, $unit, $format, $unicode, $encoding, $diskcache, $pdfa);
     // set document information
     $this->setAuthor(APP_NAME);
     $this->setCreator(APP_NAME);
     // $this->properties['Producer'] = 'Edoceo Imperium';
     // $this->setKeywords($this->name);
     //$pdf->properties['Keywords'] = 'Edoceo Imperium';
     //$pdf->properties['CreationDate']
     //$pdf->properties['ModDate'];
     //$pdf->properties['Trapped']
     // set margins
     $this->setMargins(0, 0, 0, true);
     $this->setHeaderFont(array(self::FONT_SANS, '', 12));
     $this->setHeaderMargin(0);
     $this->setPrintHeader(false);
     $this->setFooterMargin(0);
     //$this->setPrintFooter(false);
     // set auto page breaks
     $this->setAutoPageBreak(true, 1 / 2);
     //
     // set image scale factor
     $this->setImageScale(0);
     // set default font subsetting mode
     $this->setFontSubsetting(true);
     $this->setFont(self::FONT_SANS, '', 14);
     // Add a page
     // This method has several options, check the source code documentation for more information.
     //$this->addPage();
 }
Example #9
0
 function __construct($options)
 {
     $defaults = array('orientation' => 'P', 'unit' => 'mm', 'format' => 'A4', 'unicode' => true, 'encoding' => "UTF-8");
     $options = is_array($options) ? am($defaults, $options) : $defaults;
     extract(am($defaults, $options));
     parent::__construct($orientation, $unit, $format, $unicode, $encoding);
 }
Example #10
0
 /**
  * @param string $pageOrientation the pageOrientation, like "Portrait" or "Landscape". Standard is Protrait.
  * @param string $unit the measurement of the pdf-Site, like "cm", "mm", "pt" or "in". Standard: cm.
  * @param string $pageFormat the Format of the Page, like "A4". Standard: A4.
  */
 public function __construct($pageOrientation = "Portrait", $unit = "cm", $pageFormat = "A4")
 {
     parent::__construct($pageOrientation, $unit, $pageFormat);
     $this->_htmlCode = '';
     $this->_tempVarSurroundPattern = '';
     $this->_tempDirName = 'kuwasysPdf';
 }
Example #11
0
	public function __construct($websiteName, $prettyDate, $description, $language)
	{
		parent::__construct();
		$this->websiteName = $websiteName;
		$this->prettyDate = $prettyDate;
		$this->description = $description;
		
		switch($language)
		{
			case 'zh-tw':
			case 'ja':
				$reportFont = 'msungstdlight';
				break;
			
			case 'zh-cn':
				$reportFont = 'stsongstdlight';
			break;
			
			case 'ko':
				$reportFont = 'hysmyeongjostdmedium';
				break;
			
			case 'ar':
				$reportFont = 'almohanad';
				break;
				
			case 'en':
			default:
				$reportFont = 'dejavusans';
				break;
		}
		$this->reportFont = $reportFont;
	}
Example #12
0
 /**
  * override standard constructor so we can use Magento's factory
  * and pass in additional constructor arguments
  *
  * @param array $arguments array of 7 constructor arguments
  */
 public function __construct($arguments)
 {
     $cacheDir = Mage::getConfig()->getOptions()->getDir('cache');
     $pdfDir = $cacheDir . DS . 'pdfcache';
     Mage::getConfig()->getOptions()->createDirIfNotExists($pdfDir);
     list($orientation, $unit, $format, $unicode, $encoding, $diskcache, $pdfa) = $arguments;
     return parent::__construct($orientation, $unit, $format, $unicode, $encoding, $diskcache, $pdfa);
 }
 public function __construct($orientation = 'P', $unit = 'mm', $format = 'A4', $unicode = true, $encoding = 'UTF-8', $diskcache = false, $pdfa = false)
 {
     parent::__construct($orientation, $unit, $format, $unicode, $encoding, $diskcache, $pdfa);
     $this->SetCreator('COM_GGLMS');
     $this->setImageScale(PDF_IMAGE_SCALE_RATIO);
     $this->SetFont('helvetica', '', 10);
     $this->_data = array();
 }
Example #14
0
 function __construct($filename, array $data)
 {
     parent::__construct();
     $this->setFileName($filename);
     $this->setData($data);
     $this->init();
     $this->setup();
 }
Example #15
0
 /**
  *
  *
  * @param string $orientation
  * @param string $unit
  * @param string $format
  * @param bool|true $unicode
  * @param string $encoding
  * @param bool|false $diskcache
  * @param bool|false $pdfa
  */
 public function __construct($orientation = 'P', $unit = 'mm', $format = 'A4', $unicode = true, $encoding = 'UTF-8', $diskcache = false, $pdfa = false)
 {
     if (!class_exists('TCPDF', FALSE)) {
         // Load SwiftMailer
         require Kohana::find_file('vendor', 'tcpdf/tcpdf');
     }
     parent::__construct($orientation, $unit, $format, $unicode, $encoding, $diskcache, $pdfa);
     // TODO:
 }
Example #16
0
 /**
  * Constructs PDF and configures standard parameters.
  *
  * @param string  $orientation page orientation
  * @param string  $unit        unit
  * @param mixed   $format      the format used for pages
  * @param boolean $unicode     true means that the input text is unicode
  * @param string  $encoding    charset encoding; default is UTF-8.
  * @param boolean $diskcache   if true reduce the RAM memory usage by caching
  *                             temporary data on filesystem (slower).
  * @param boolean $pdfa        If TRUE set the document to PDF/A mode.
  *
  * @access public
  */
 public function __construct($orientation = 'P', $unit = 'mm', $format = 'A4', $unicode = true, $encoding = 'UTF-8', $diskcache = false, $pdfa = false)
 {
     parent::__construct($orientation, $unit, $format, $unicode, $encoding, $diskcache, $pdfa);
     $this->SetAuthor('phpMyAdmin ' . PMA_VERSION);
     $this->AddFont('DejaVuSans', '', 'dejavusans.php');
     $this->AddFont('DejaVuSans', 'B', 'dejavusansb.php');
     $this->SetFont(PMA_PDF_FONT, '', 14);
     $this->setFooterFont(array(PMA_PDF_FONT, '', 14));
 }
Example #17
0
 /**
  *	Constructor
  * @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>
  * @param boolean $unicode TRUE means that the input text is unicode (default = true)
  * @param boolean $diskcache if TRUE reduce the RAM memory usage by caching temporary data on filesystem (slower).
  * @param String $encoding charset encoding; default is UTF-8
  */
 public function __construct($orientation = 'P', $unit = 'mm', $format = 'A4', $unicode = true, $encoding = 'UTF-8', $diskcache = false)
 {
     global $pdfpref;
     //Call parent constructor
     parent::__construct($orientation, $unit, $format, $unicode, $encoding, $diskcache);
     //Initialization
     $this->setCellHeightRatio(1.25);
     // Should already be the default
 }
 public function __construct($orientation = 'P', $unit = 'mm', $format = 'A4', $unicode = true, $encoding = 'UTF-8')
 {
     parent::__construct($orientation, $unit, $format, $unicode, $encoding);
     $this->SetFont('', '', 10);
     // SalesPlatform.ru begin
     //$this->setFontFamily('times');
     $this->setFontFamily('helvetica');
     // SalesPlatform.ru end
 }
Example #19
0
 /**
  * Constructor de la clase
  * @param o Orientación
  * @param u Unidad de medida
  * @param s Tipo de hoja
  * @param top Margen extra (al normal) para la parte de arriba del PDF
  * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]delaf.cl)
  * @version 2015-09-08
  */
 public function __construct($o = 'P', $u = 'mm', $s = 'Letter', $top = 8)
 {
     parent::__construct($o, $u, $s);
     $this->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP + $top, PDF_MARGIN_RIGHT);
     $this->SetHeaderMargin(PDF_MARGIN_HEADER + $top);
     $this->SetFooterMargin(PDF_MARGIN_FOOTER);
     $this->SetCreator('LibreDTE (http://libredte.cl)');
     $this->SetAuthor('LibreDTE (http://libredte.cl)');
     $this->setFont('helvetica');
 }
 public function __construct($orientation = 'P', $unit = 'mm', $format = 'A4', $unicode = false, $encoding = 'ISO-8559-1', $diskcache = false)
 {
     parent::__construct($orientation, $unit, $format, $unicode, $encoding, $diskcache);
     $this->SetCreator(PDF_CREATOR);
     $this->SetAutoPageBreak(false, 0);
     $this->linestyleCap = '2 J';
     $this->setPrintHeader(false);
     $this->jpeg_quality = 90;
     $this->SetMyFooter();
 }
Example #21
0
 /**
  * Create a basic document (without any content so far).
  * @param string $orientation page orientation. Possible values are (case insensitive):<ul><li>P or Portrait (default)</li><li>L or Landscape</li><li>'' (empty string) for automatic orientation</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 string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat().
  * @param boolean $unicode TRUE means that the input text is unicode (default = false)
  * @param String $encoding charset encoding; default is ISO-8859-1
  */
 public function __construct($orientation = 'P', $unit = 'mm', $format = 'A4', $unicode = false, $encoding = 'ISO-8859-1')
 {
     $this->config = Config::GetInstance();
     if ($this->config->getValue('LOAD_EXTERNAL_MEDIA') == 'proxy') {
         $this->media_proxy = new MediaProxy();
     }
     parent::__construct($orientation, $unit, $format, $unicode, $encoding, false);
     $this->getDomains();
     $this->setDefaults();
 }
Example #22
0
 public function __construct($orientation = 'P', $unit = 'mm', $format = 'A4', $encoding = null)
 {
     if ($encoding === null) {
         $encoding = $GLOBALS['gJConfig']->charset;
     }
     parent::__construct($orientation, $unit, $format, $encoding == 'UTF-8' || $encoding == 'UTF-16', $encoding);
     $this->setHeaderFont(array('helvetica', '', 10));
     $this->setFooterFont(array('helvetica', '', 10));
     $this->setFont('helvetica', '', 10);
 }
Example #23
0
 public function __construct($orientation = 'P', $unit = 'mm', $format = 'A4', $unicode = true, $encoding = 'UTF-8', $diskcache = false)
 {
     parent::__construct($orientation, $unit, $format, $unicode, $encoding, $diskcache);
     $this->SetCreator(PDF_CREATOR);
     $this->SetAutoPageBreak(false, 0);
     $this->SetLineStyle(array('cap' => 'square'));
     $this->setPrintHeader(false);
     $this->jpeg_quality = 90;
     $this->SetMyFooter();
 }
Example #24
0
 /**
  * Init method.
  *
  * @param string  $title Title.
  * @param string  $font  Font name.
  * @param boolean $logo  Logo.
  */
 public function __construct($title, $font = 'helvetica', $logo = false)
 {
     parent::__construct();
     $this->title = $title;
     $this->logo = $logo;
     $this->font = $font;
     $this->SetTitle($title);
     $this->setFontSubsetting(true);
     $this->setCellPaddings(3, 3, 3, 3);
 }
Example #25
0
 function __construct($map, $printScale, $orientation, $units, $format, $pdfSettings, $prefmap = true)
 {
     parent::__construct($orientation, $units, $format, true);
     // only for tcpdf version >= 3
     // - font not well defined --> errors
     // - header and footer printed = lines on top and bottom
     $this->setPrintHeader(false);
     $this->setPrintFooter(false);
     $mapW = $pdfSettings['width'];
     $mapH = $pdfSettings['height'];
     $this->pdfSettings = $pdfSettings;
     $this->prefmap = $prefmap;
     // this function init all position parameters, legend, ...
     $this->initDimensions($mapW, $mapH);
     // printmap creation done in derivated classes :
     $this->createPrintMap($map, $mapW, $mapH, $printScale, 'pdf', 144, false, true, $pdfSettings);
     // avoid bad title
     $title = $pdfSettings['printtitle'] ? $pdfSettings['printtitle'] : $pdfSettings['pdftitle'];
     $this->initPDF($pdfSettings['author'], $title, $pdfSettings['defFont'], $pdfSettings['defFontSize']);
     $this->printPDF($map, $mapW, $mapH, $this->printUrlList, $printScale);
     // scale is now printed in printPDF because of bgcolor and framesLines
     //$this->printScale(_p("Scale"), $printScale);
     // printLegend function to call depends on the type of legend man want
     //$this->printLegendPDF($map, $printScale, 30, 500);
     switch ($this->legendPosition) {
         case "none":
             // no legend
         // no legend
         case "imgms":
             // image generated with MapServer
             break;
         case "custom":
             // a custom legend will be inserted outside this class (so do the same as bottom legend)
             $this->printLegendPDFCustom($map, $printScale);
             break;
         case "imgbr":
             // a fixed image instead of dyn legend
             $this->Image($this->pdfSettings["img"], $this->xLegStart, $this->yLegStart, $this->xmaxM - $this->xLegStart - 1, $this->ymaxM - $this->yLegStart - 1);
             break;
         case "R":
             // legend on the right
         // legend on the right
         case "B":
             // bottom
         // bottom
         case "BC":
             // bottom
         // bottom
         default:
             // default = bottom
             $this->printLegendPDF($map, $printScale);
             break;
     }
 }
Example #26
0
 public function __construct()
 {
     parent::__construct();
     $this->setHeaderData('', 0, '', '', array(0, 0, 0), array(255, 255, 255));
     $this->setFooterData(array(35, 44, 121), array(255, 255, 255));
     $this->SetTopMargin(25);
     $this->SetLeftMargin(25);
     $this->SetRightMargin(30);
     $this->AddPage();
     $this->AcceptPageBreak();
 }
Example #27
0
 /**
  * @param string $orientation Orientaion of page (Default: P)
  */
 public function __construct($orientation = 'P', $print = false)
 {
     parent::__construct($orientation, $unit = 'mm', $format = 'A4', $unicode = true, $encoding = 'UTF-8', $diskcache = false, $pdfa = false);
     $this->setMargins(15, 15);
     $this->SetAutoPageBreak(true, 25);
     $this->setHtmlVSpace(array('h1' => array(0 => array('h' => 0, 'n' => 0), 1 => array('h' => 5, 'n' => 1)), 'h2' => array(0 => array('h' => 6, 'n' => 1), 1 => array('h' => 2, 'n' => 1))));
     $preferences = array('PrintScaling' => 'None');
     $this->setViewerPreferences($preferences);
     if ($print) {
         $this->IncludeJS('print(true);');
     }
 }
Example #28
0
 public function __construct($orientation = 'P', $unit = 'mm', $format = 'A4', $unicode = true, $encoding = 'UTF-8', $diskcache = false, $pdfa = false)
 {
     if (is_string($unicode)) {
         // support of previous behavior
         $encoding = $unicode;
         $unicode = $encoding == 'UTF-8' || $encoding == 'UTF-16';
     }
     parent::__construct($orientation, $unit, $format, $unicode, $encoding, $diskcache, $pdfa);
     $this->setHeaderFont(array('helvetica', '', 10));
     $this->setFooterFont(array('helvetica', '', 10));
     $this->setFont('helvetica', '', 10);
 }
Example #29
0
 public function __construct($component = null, $format = 'A4')
 {
     $this->_component = $component;
     parent::__construct("P", "mm", $format);
     $this->SetFont($this->_font, "B", 16);
     $this->SetAuthor("Vivid Planet Software GmbH");
     $this->SetCreator("Vivid Planet Software GmbH mit FPDF");
     $this->SetTitle("");
     $this->setLIsymbol(utf8_encode(chr(0x95)));
     // = •
     $this->setListIndentWidth($this->getStringWidth("00"));
 }
 public function __construct(array $data)
 {
     exit(print_r($data));
     parent::__construct($orientation = 'P', $unit = 'mm', $format = 'A4', $unicode = true, $encoding = 'UTF-8', $diskcache = false, $pdfa = false);
     exit(print_r($data));
     $this->numero = $data['nro_control'];
     $this->fecha = $data['fecha_emision'];
     $this->cliente = $data['nombre_apellido'];
     $this->cedula = $data['nacionalidad'] . "-" . $data['cedula'];
     $this->direccion = $data['direccion'];
     $this->parroquia = $data['parroquia'];
     $this->municipio = $data['municipio'];
 }