set PDF metadata

Cette révision appartient à :
Daniel Seifert 2020-06-09 22:49:47 +02:00
Parent d194491675
révision c931ac19f3
2 fichiers modifiés avec 9 ajouts et 1 suppressions

Voir le fichier

@ -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;
}

Voir le fichier

@ -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}]