From c931ac19f309b5def3a13781ade6c834ffdf4535 Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Tue, 9 Jun 2020 22:49:47 +0200 Subject: [PATCH] set PDF metadata --- Application/Model/AbstractClasses/pdfdocumentsGeneric.php | 8 ++++++++ Application/views/tpl/documents/invoice/invoice.tpl | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Application/Model/AbstractClasses/pdfdocumentsGeneric.php b/Application/Model/AbstractClasses/pdfdocumentsGeneric.php index bdda72c..dbb7a54 100644 --- a/Application/Model/AbstractClasses/pdfdocumentsGeneric.php +++ b/Application/Model/AbstractClasses/pdfdocumentsGeneric.php @@ -68,7 +68,12 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface public function genPdf($sFilename, $iSelLang = 0, $target = self::PDF_DESTINATION_STDOUT) { $oPdf = oxNew(Html2Pdf::class, ...$this->getPdfProperties()); + $oPdf->setTestIsImage(false); $oPdf->writeHTML($this->getHTMLContent($iSelLang)); + $oPdf->pdf->SetAuthor(Registry::getConfig()->getActiveShop()->getFieldData('oxname')); + $oPdf->pdf->SetTitle(Registry::getLang()->translateString($this->getTitleIdent())); + $oPdf->pdf->SetCreator('D³ PDF Documents for OXID eShop'); + $oPdf->pdf->SetSubject(NULL); return $oPdf->output($sFilename, $target); } @@ -142,6 +147,7 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface */ public function getHTMLContent($iSelLang = 0) { + $blCurrentRenderFromAdmin = self::$_blIsAdmin; self::$_blIsAdmin = $this->renderTemplateFromAdmin(); $lang = Registry::getLang(); @@ -155,6 +161,8 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface $lang->setTplLanguage($currTplLang); + self::$_blIsAdmin = $blCurrentRenderFromAdmin; + return $content; } diff --git a/Application/views/tpl/documents/invoice/invoice.tpl b/Application/views/tpl/documents/invoice/invoice.tpl index 71075d8..f1ddb8c 100644 --- a/Application/views/tpl/documents/invoice/invoice.tpl +++ b/Application/views/tpl/documents/invoice/invoice.tpl @@ -6,7 +6,7 @@ [{include file="d3pdfstyle.css"}] - + [{block name="pdfTopingFile"}] [{include file="d3pdfheader.tpl" showLogo=true}]