add ordermanager combination

This commit is contained in:
2020-06-08 16:39:33 +02:00
parent 3c871862d6
commit c1ce7ac95c
5 changed files with 109 additions and 3 deletions

View File

@ -66,7 +66,7 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
$sFilename = $this->getFilename();
$oPdf = oxNew(Html2Pdf::class, ...$this->getPdfProperties());
$oPdf->writeHTML($this->getHTMLContent($iSelLang));
$oPdf->output($sFilename, $target);
return $oPdf->output($sFilename, $target);
}
/**
@ -84,6 +84,30 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
}
}
/**
* @param int $iLanguage
*
* @return null|string
* @throws Html2PdfException
*/
public function getPdfContent($iLanguage = 0)
{
try {
$sFilename = $this->getFilename();
ob_start();
//$this->genPdf( $sFilename, $iLanguage, self::PDF_DESTINATION_STDOUT );
$this->genPdf( $sFilename, $iLanguage, self::PDF_DESTINATION_STRING );
return ob_get_contents();
} catch (pdfGeneratorExceptionAbstract $e) {
Registry::get(UtilsView::class)->addErrorToDisplay($e);
Registry::getLogger()->error($e);
} catch (\Exception $e) {
dumpvar($e->getMessage());
}
return null;
}
public function setSmartyVars()
{
$this->oSmarty->assign('oConfig', Registry::getSession()->getConfig());