Ejemplo n.º 1
0
 function reset(&$media)
 {
     parent::reset($media);
     $this->pdf =& new FPDF('P', 'pt', array(mm2pt($media->width()), mm2pt($media->height())));
     if (defined('DEBUG_MODE')) {
         $this->pdf->SetCompression(false);
     } else {
         $this->pdf->SetCompression(true);
     }
     $this->cx = 0;
     $this->cy = 0;
     $this->locallinks = array();
 }
 function reset(&$media)
 {
     OutputDriverGenericPDF::reset($media);
     $this->pdf = new FPDF("P", "pt", array(mm2pt($media->width()), mm2pt($media->height())));
     $this->pdf->SetCompression(0);
     $this->pdf->AddPage();
     $this->cx = 0;
     $this->cy = 0;
     $this->locallinks = array();
 }
Ejemplo n.º 3
0
 function reset(&$media)
 {
     OutputDriverGenericPDF::reset($media);
     // Check if PDFLIB is available
     if (!extension_loaded('pdf')) {
         // Try to use "dl" to dynamically load PDFLIB
         $result = dl(PDFLIB_DL_PATH);
         if (!$result) {
             readfile(HTML2PS_DIR . 'templates/missing_pdflib.html');
             error_log("No PDFLIB extension found");
             die("HTML2PS Error");
         }
     }
     $this->pdf = pdf_new();
     // Set PDF compatibility level
     pdf_set_parameter($this->pdf, "compatibility", $this->get_pdf_version());
     /**
      * Use PDF license key, if present
      *
      * PDFLIB_LICENSE constant is defined in 'config.inc.php' file in "PDFLIB-specific" section.
      */
     if (defined("PDFLIB_LICENSE")) {
         pdf_set_parameter($this->pdf, "license", PDFLIB_LICENSE);
     }
     pdf_open_file($this->pdf, $this->get_filename());
     // @TODO: compression level, debug
     pdf_set_value($this->pdf, "compress", 0);
     // Set path to the PDFLIB UPR file containig information about fonts and encodings
     if (defined("PDFLIB_UPR_PATH")) {
         pdf_set_parameter($this->pdf, "resourcefile", PDFLIB_UPR_PATH);
     }
     // Setup encodings not bundled with PDFLIB
     $filename = $this->generate_cpg('koi8-r');
     pdf_set_parameter($this->pdf, 'Encoding', sprintf('koi8-r=%s', $filename));
     // Setup font outlines
     global $g_font_resolver_pdf;
     $g_font_resolver_pdf->setup_ttf_mappings($this->pdf);
     $pdf = $this->pdf;
     pdf_set_info($pdf, "Creator", "html2ps (PHP version)");
     // No borders around links in the generated PDF
     pdf_set_border_style($this->pdf, "solid", 0);
     $this->_status = PDFLIB_STATUS_DOCUMENT_STARTED;
 }
Ejemplo n.º 4
0
 function reset(&$media)
 {
     parent::reset($media);
     if (is_array($media->security)) {
         $this->pdf =& new FPDF_Protection('P', 'pt', array(mm2pt($media->width()), mm2pt($media->height())));
         //Set Protection
         $this->pdf->SetProtection($media->getSecurityPermissions(), $media->getSecurityOpenPassword(), $media->getSecurityOwnerPassword());
     } else {
         $this->pdf =& new FPDF('P', 'pt', array(mm2pt($media->width()), mm2pt($media->height())));
     }
     if (defined('DEBUG_MODE')) {
         $this->pdf->SetCompression(false);
     } else {
         $this->pdf->SetCompression(true);
     }
     $this->pdf->AddPage();
     $this->cx = 0;
     $this->cy = 0;
     $this->locallinks = array();
 }