Skip to content

Commit

Permalink
PdfExport: Also use temp local storage for cover pages
Browse files Browse the repository at this point in the history
fixes #55
  • Loading branch information
nilmerg committed May 3, 2022
1 parent 6e556b8 commit c660b8d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions library/Pdfexport/ProvidedHook/Pdfexport.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,13 @@ public function htmlToPdf($html)

if ($html instanceof PrintableHtmlDocument && ($coverPage = $html->getCoverPage()) !== null) {
$coverPagePdf = $chrome
->fromHtml((new PrintableHtmlDocument())
->add($coverPage)
->addAttributes($html->getAttributes())
->removeMargins())
->fromHtml(
(new PrintableHtmlDocument())
->add($coverPage)
->addAttributes($html->getAttributes())
->removeMargins(),
static::getForceTempStorage()
)
->toPdf();

$merger = new Merger(new TcpdiDriver());
Expand Down Expand Up @@ -108,7 +111,8 @@ public function streamPdfFromHtml($html, $filename)
(new PrintableHtmlDocument())
->add($coverPage)
->addAttributes($html->getAttributes())
->removeMargins()
->removeMargins(),
static::getForceTempStorage()
)
->toPdf();

Expand Down

0 comments on commit c660b8d

Please sign in to comment.