set PDF metadata

This commit is contained in:
2020-06-09 22:49:47 +02:00
parent 4c561976a6
commit cf2c61078a
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;
}