set PDF metadata

This commit is contained in:
Daniel Seifert 2020-06-09 22:49:47 +02:00
parent 4c561976a6
commit cf2c61078a
Signed by: DanielS
GPG Key ID: 6A513E13AEE66170
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)
{
$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;
}

View File

@ -6,7 +6,7 @@
[{include file="d3pdfstyle.css"}]
</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>
[{block name="pdfTopingFile"}]
[{include file="d3pdfheader.tpl" showLogo=true}]