Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DPI 300 footer/header issues #509

Open
uvolos opened this issue Jul 18, 2023 · 1 comment
Open

DPI 300 footer/header issues #509

uvolos opened this issue Jul 18, 2023 · 1 comment

Comments

@uvolos
Copy link

uvolos commented Jul 18, 2023

With DPI 96 all looks fine
With DPI 300 header/footer moving to the center of page

DPI 96
Снимок экрана 2023-07-18 в 13 19 48

DPI 300
Снимок экрана 2023-07-18 в 13 20 13

Example:

$pdf = \App::make('snappy.pdf.wrapper');

$pdf->setOptions([
    'disable-smart-shrinking' => true,
    'page-size' => 'A4',
    'orientation' => 'portrait',
    'dpi' => 300, // 96
]);

function htm($content) {
   return "<!DOCTYPE html><html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'/></head><body>$content</body></html>";
}
$pdf->setOption('header-html', htm('<div style="background: red;">HEADER</div>'));
$pdf->setOption('footer-html', htm('<div style="background: blue;">FOOTER</div>'));
$pdf->loadHTML(htm('<div style="background: green">CONTENT</div>'));

$response = $pdf->download();
@uvolos
Copy link
Author

uvolos commented Jul 20, 2023

UPD:
wkhtmltopdf issue wkhtmltopdf/wkhtmltopdf#3378

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant