/** * 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"]); }
public function Load() { parent::$PAGE_TITLE = __(HOME_PAGE_TITLE); // Welcome message $small_img = new Picture("img/logo_16x16.png", 16, 16, 0, Picture::ALIGN_ABSMIDDLE); $title_header = new Object($small_img, __(WELCOME)); $welcome_box = new Box($title_header, true, Box::STYLE_SECOND, Box::STYLE_SECOND, "", "welcome_box", 600); $welcome_obj = new Object(__(WELCOME_MSG)); list($strAdminLogin, $strAdminPasswd, $strAdminRights) = getWspUserRightsInfo("admin"); $quickstart_obj = new Object(new Picture("img/quickstart_128.png", 64, 64), "<br/>", __(QUICKSTART)); $quickstart_link = new Link("http://www.website-php.com/" . $this->getLanguage() . "/quick-start.html", Link::TARGET_BLANK, $quickstart_obj); $quickstart_box = new RoundBox(3, "quickstart_box", 120, 120); $quickstart_box->setValign(RoundBox::VALIGN_CENTER); $quickstart_box->setContent($quickstart_link); $tutorial_obj = new Object(new Picture("img/tutorials_128.png", 64, 64), "<br/>", __(TUTORIALS)); $tutorial_link = new Link("http://www.website-php.com/" . $this->getLanguage() . "/tutorials.html", Link::TARGET_BLANK, $tutorial_obj); $tutorial_box = new RoundBox(3, "tutorial_box", 120, 120); $tutorial_box->setValign(RoundBox::VALIGN_CENTER); $tutorial_box->setContent($tutorial_link); $connect_obj = new Object(new Picture("img/wsp-admin/admin_128.png", 64, 64), "<br/>", __(CONNECT)); $connect_link = new Link("wsp-admin/connect.html", Link::TARGET_BLANK, $connect_obj); $connect_box = new RoundBox(3, "connect_box", 120, 120); $connect_box->setValign(RoundBox::VALIGN_CENTER); $connect_box->setContent($connect_link); $icon_table = new Table(); $icon_table->setDefaultAlign(RowTable::ALIGN_CENTER)->setDefaultValign(RowTable::VALIGN_TOP); $icon_row = $icon_table->addRowColumns($quickstart_box, " ", $tutorial_box, " ", $connect_box); $icon_row->setColumnWidth(5, 120); if ($strAdminLogin == "admin" && $strAdminPasswd == sha1("admin")) { $finalize = new Font(__(FINALIZE_INSTALL)); $finalize->setFontColor("red"); $finalize->setFontWeight(Font::FONT_WEIGHT_BOLD); $welcome_obj->add("<br/>", $finalize, "<br/>", __(CONNECT_DEFAULT_PASSWD), "<br/>"); } $welcome_obj->add("<br/>", $icon_table); $welcome_box->setContent($welcome_obj); // Footer $this->render = new Template($welcome_box); }
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; }