structure = $structure; $this->fontName = $fontName; $this->SetAutoPageBreak(true, PDF_MARGIN_BOTTOM); $this->SetMargins(10, 35, 10); // generic PDF information $this->setTitle($this->structure->getTitle()); $this->setCreator("LDAP Account Manager"); $this->setAuthor("LDAP Account Manager"); // footer $this->setPrintFooter(true); } /** * {@inheritDoc} * @see TCPDF::Header() */ public function Header(): void { $logoFile = $this->structure->getLogo(); $pdfStructurePersistenceManager = new PdfStructurePersistenceManager(); if (!empty($logoFile) && ($logoFile !== PDFStructure::NO_LOGO)) { $logoBinary = $pdfStructurePersistenceManager->getPdfLogoBinary($_SESSION['config']->getName(), $logoFile); if (!empty($logoBinary)) { $imageConverter = ImageManipulationFactory::getImageManipulator($logoBinary); $imageConverter->convertToJpeg(); $this->Image('@' . $imageConverter->getImageData(), 10, 10, 0, 15, 'JPG', '', 'T'); } else { logNewMessage(LOG_ERR, 'Unable to read PDF logo ' . $logoFile); $this->SetY(10); } } else { $this->SetY(10); } $this->SetFont($this->fontName, '', 20); $this->Cell(0, 15, $this->structure->getTitle(), 0, 1, 'R', false, '', 0, false, 'M'); //set folding marks if ($this->structure->getFoldingMarks() == PDFStructure::FOLDING_STANDARD) { $this->SetLineWidth(0.2); $foldingMarks = [97, 202]; foreach ($foldingMarks as $mark) { $this->Line(0, $mark, 5, $mark); } } } /** * {@inheritDoc} * @see TCPDF::Footer() */ public function Footer(): void { $this->SetY(-15); $this->SetFont($this->fontName, '', LAMPDF_FONT_SIZE); $footerText = _("This document was automatically created by LDAP Account Manager") . ' (' . getFormattedTime('Y-m-d H:i:s T') . ')'; $this->Cell(0, 10, $footerText, 0, 0, 'C'); } }