Beispiel #1
0
 /**
  * Place watermark on the page if it is not licensed version
  * 
  * @param pdfWriter {@link PdfWriter}
  * @throws DocumentException
  */
 private static function showTestMode($pdfDocument, $pdfWriter)
 {
     if (self::isLicensed()) {
         return;
     }
     $font = new Font();
     $font->setFontSize(25);
     $font->setFontColor("#B5B5B5");
     $font->setFont($pdfWriter);
     $text = "WebORB PDF Gen Evaluation Copy";
     $width = $pdfWriter->GetStringWidth($text);
     $center["x"] = $pdfDocument->width / 2;
     if ($width / 2 > $center["x"]) {
         $width = $center["x"] * 2;
     }
     $center["y"] = $pdfDocument->height / 2;
     $pdfWriter->Rotate(45, $center["x"], $center["y"]);
     $pdfWriter->SetXY($center["x"] - $width / 2, $center["y"]);
     $pdfWriter->Cell($width, 36, $text, 0, 0, "C");
     $pdfWriter->Rotate(0, $center["x"], $center["y"]);
 }
Beispiel #2
0
 public function getFont($newFontColor = -1, $newFontWeight = "", $newFontStyle = "")
 {
     $result = new Font();
     $result->setFontSize($this->fontSize);
     $result->setFontFamily($this->fontFamily);
     $result->setFontStyle($newFontWeight !== "" ? $newFontWeight : $this->fontWeight, $newFontStyle !== "" ? $newFontStyle : $this->fontStyle);
     $result->setFontColor($newFontColor !== -1 ? $newFontColor : $this->fontColor);
     return $result;
 }