We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi there,
Thanks for this library - just switched to it from wkhtmltopdf, so please forgive me if this is due to my own ignorance.
It seems like the landscape option is not quite working? Or I'm missing setting something?
landscape
I've made sure I got all the dependencies installed on the server. Here's what I've done:
// Our input is HTML. $input = new StringInput(); $input->setHtml($twigHtml); // Initialise converter and set output as raw PDF content $converter = new Converter($input, new StringOutput()); // Set page options. $converter->setOptions([ 'format' => 'A5', 'margin' => [ 'top' => '1.5cm', 'right' => '1.5cm', 'bottom' => '1.5cm', 'left' => '1.5cm', ], 'landscape' => true ]); // Return the raw PDF content. return $converter->convert()->get();
I had to end up setting the preferCSSPageSize option to true and add the below to the @page at-rule in the CSS.
preferCSSPageSize
@page
@page { size: A5 landscape; }
Thanks again, Zander
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi there,
Thanks for this library - just switched to it from wkhtmltopdf, so please forgive me if this is due to my own ignorance.
It seems like the
landscape
option is not quite working? Or I'm missing setting something?I've made sure I got all the dependencies installed on the server. Here's what I've done:
I had to end up setting the
preferCSSPageSize
option to true and add the below to the@page
at-rule in the CSS.Thanks again,
Zander
The text was updated successfully, but these errors were encountered: