-
Notifications
You must be signed in to change notification settings - Fork 113
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
Failing to render the mobile view on print #218
Comments
it's not entirely clear what you're asking here, and it's also not entirely clear what you've tried in isolation to other attempts. Are you saying that you have CSS that uses media queries to reflow your page at different break points? What happens if you view the page you're trying to convert in Chrome with the width/height set to 640/900. Does that look right? Then if you go to the print preview ? That's what Puppeteer will essentially return.. Does that look right? |
Sorry for not making it clearer, |
It sounds like this CSS library you're using only applies to the If that is the case, then adding |
I have tried with |
Did you try set the width and height but NOT set the page format? I see you're setting it to A4 which will likely overload the width and height options. This works fine for me:
|
I am trying to switch from pdfkit to
grover
and for whatever reasonpdfkit
was printing the pages in mobile view by default without any configs. This worked in our favour as the mobile view is more print friendly.But now I'm struggling to replicate this behaviour.
I tried to changed the
viewport
to a value that would trigger the mobile view, but this doesn't seem to work:Is it possible to achieve this without creating specific views? Am I using the
viewport
setting incorrectly?The text was updated successfully, but these errors were encountered: