Esempio n. 1
0
 /**
  * PDF Setup - ReportPdf
  */
 public function setup()
 {
     parent::setup();
     // Setup the PDF class with custom size pages because WT supports more page sizes. If WT sends an unknown size name then the default would be A4
     $this->pdf = new ReportTcpdf($this->orientation, parent::UNITS, array($this->pagew, $this->pageh), self::UNICODE, "UTF-8", self::DISK_CACHE);
     // 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);
     // Set font subsetting
     $this->pdf->setFontSubsetting(self::SUBSETTING);
     // 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 = WT_WEBTREES;
     if (Auth::isAdmin()) {
         $appversion .= " " . WT_VERSION;
     }
     $this->pdf->SetCreator($appversion . " (" . parent::WT_URL . ")");
     // Not implemented yet - ReportBase::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 ReportPdfCell(0, 10, 0, "C", "", "genby", 1, ".", ".", 0, 0, "", "", true);
         $element->addText($this->generatedby);
         $element->setUrl(parent::WT_URL);
         $this->pdf->addFooter($element);
     }
 }