示例#1
0
 /**
  * PDF Setup - PGVReportBasePDF
  */
 function setup()
 {
     parent::setup();
     // Setup the PDF class with custom size pages because PGV supports more page sizes. If PGV sends an unknown size name then the default would be A4
     $this->pdf = new PGVRPDF($this->orientation, parent::unit, array($this->pagew, $this->pageh), self::unicode, $this->charset, self::diskcache);
     // Setup the PDF margins
     $this->pdf->setMargins($this->leftmargin, $this->topmargin, $this->rightmargin);
     $this->pdf->SetHeaderMargin($this->headermargin);
     $this->pdf->SetFooterMargin($this->footermargin);
     //Set auto page breaks
     $this->pdf->SetAutoPageBreak(true, $this->bottommargin);
     // Setup PDF compression
     $this->pdf->SetCompression(self::compression);
     // Setup RTL support
     $this->pdf->setRTL($this->rtl);
     // Set the document information
     // Only admin should see the version number
     $appversion = PGV_PHPGEDVIEW;
     if (PGV_USER_IS_ADMIN) {
         $appversion .= " " . PGV_VERSION_TEXT;
     }
     $this->pdf->SetCreator($appversion . ' (' . parent::pgv_url . ')');
     // Not implemented yet - PGVReportBase::setup()
     //		$this->pdf->SetAuthor($this->rauthor);
     $this->pdf->SetTitle($this->title);
     $this->pdf->SetSubject($this->rsubject);
     $this->pdf->SetKeywords($this->rkeywords);
     $this->pdf->setReport($this);
     if ($this->showGenText) {
         // The default style name for Generated by.... is 'genby'
         $element = new PGVRCellPDF(0, 10, 0, 'C', '', 'genby', 1, '.', '.', 0, 0, '', '', true);
         $element->addText($this->generatedby);
         $element->setUrl(parent::pgv_url);
         $this->pdf->addFooter($element);
     }
 }
示例#2
0
 /**
  * HTML Setup - PGVReportBaseHTML
  */
 function setup()
 {
     parent::setup();
     // Setting up the correct dimensions if Portrait (default) or Landscape
     if ($this->orientation == 'landscape') {
         $tmpw = $this->pagew;
         $this->pagew = $this->pageh;
         $this->pageh = $tmpw;
     }
     // Store the pagewidth without margins
     $this->noMarginWidth = floor($this->pagew - $this->leftmargin - $this->rightmargin);
     // If RTL, switch the alignment
     if ($this->rtl) {
         $this->rtlalign = "right";
     }
     if ($this->showGenText) {
         // The default style name for Generated by.... is 'genby'
         $element = new PGVRCellHTML(0, 10, 0, 'C', '', 'genby', 1, '.', '.', 0, 0, '', '', true);
         $element->addText($this->generatedby);
         $element->setUrl(parent::pgv_url);
         $this->footerElements[] = $element;
     }
 }