set PDF metadata

This commit is contained in:
Daniel Seifert 2020-06-09 22:49:47 +02:00
parent d194491675
commit c931ac19f3
2 changed files with 9 additions and 1 deletions

View File

@ -68,7 +68,12 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
public function genPdf($sFilename, $iSelLang = 0, $target = self::PDF_DESTINATION_STDOUT) public function genPdf($sFilename, $iSelLang = 0, $target = self::PDF_DESTINATION_STDOUT)
{ {
$oPdf = oxNew(Html2Pdf::class, ...$this->getPdfProperties()); $oPdf = oxNew(Html2Pdf::class, ...$this->getPdfProperties());
$oPdf->setTestIsImage(false);
$oPdf->writeHTML($this->getHTMLContent($iSelLang)); $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); return $oPdf->output($sFilename, $target);
} }
@ -142,6 +147,7 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
*/ */
public function getHTMLContent($iSelLang = 0) public function getHTMLContent($iSelLang = 0)
{ {
$blCurrentRenderFromAdmin = self::$_blIsAdmin;
self::$_blIsAdmin = $this->renderTemplateFromAdmin(); self::$_blIsAdmin = $this->renderTemplateFromAdmin();
$lang = Registry::getLang(); $lang = Registry::getLang();
@ -155,6 +161,8 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
$lang->setTplLanguage($currTplLang); $lang->setTplLanguage($currTplLang);
self::$_blIsAdmin = $blCurrentRenderFromAdmin;
return $content; return $content;
} }

View File

@ -6,7 +6,7 @@
[{include file="d3pdfstyle.css"}] [{include file="d3pdfstyle.css"}]
</style> </style>
<page backtop="30mm" backbottom="30mm" backleft="10mm" backright="10mm" pageset="new"> <page backtop="30mm" backbottom="30mm" backleft="10mm" backright="10mm" pageset="new" orientation="P" format="A4">
<page_header> <page_header>
[{block name="pdfTopingFile"}] [{block name="pdfTopingFile"}]
[{include file="d3pdfheader.tpl" showLogo=true}] [{include file="d3pdfheader.tpl" showLogo=true}]