M
M
MasterCopipaster2020-07-08 18:27:39
PDF
MasterCopipaster, 2020-07-08 18:27:39

Laravel print to pdf incorrect page display how to fix?

Good day, I encountered a strange behavior of the virtual printer in laravel for a pdf file , I
use laravel-dompdf
When printing the layout from the browser, everything looks fine
5f05e4d553038566026441.png
But when I send the same layout for printing through laravel-dompdf, I see an incorrect display
5f05e534d5681802606382.png
What I managed to get the same effect in the browser unchecking ignore scaling in ff
5f05e56a33bbf177793217.png
I send it to print like this:

$pdf = PDF::loadView('pdf.score',['ttf' => $ttf,'img' => $img, "field" => $field])->setPaper('a4')->setWarnings(false)
            ->setOptions(['isHtml5ParserEnabled' => true,'isPhpEnabled' => true, 'isFontSubsettingEnabled' => true,'isJavascriptEnabled' => false]);

Can anyone tell me what's wrong? Or how can I include this magic scaling in PDF::loadView? I looked through the documentation and didn't find anything.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
snowmage, 2020-07-09
@snowmage

DOMPDF can't scale. In order for the document to fit on the page, it must be laid out adaptively.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question