Exemple #1
0
 /**
  * PDF Setup - WT_Report_PDF
  */
 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 PDF($this->orientation, parent::unit, array($this->pagew, $this->pageh), self::unicode, "UTF-8", 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);
     // 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 - WT_Report_Base::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 CellPDF(0, 10, 0, "C", "", "genby", 1, ".", ".", 0, 0, "", "", true);
         $element->addText($this->generatedby);
         $element->setUrl(parent::wt_url);
         $this->pdf->addFooter($element);
     }
 }
Exemple #2
0
 /**
  * HTML Setup - WT_Report_HTML
  */
 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 = (int) ($this->pagew - $this->leftmargin - $this->rightmargin);
     // If RTL
     if ($this->rtl) {
         $this->alignRTL = "right";
         $this->entityRTL = "‏";
     }
     // Change the default HTML font name
     $this->defaultFont = "Arial";
     if ($this->showGenText) {
         // The default style name for Generated by.... is 'genby'
         $element = new CellHTML(0, 10, 0, 'C', '', 'genby', 1, '.', '.', 0, 0, '', '', true);
         $element->addText($this->generatedby);
         $element->setUrl(parent::wt_url);
         $this->footerElements[] = $element;
     }
 }