Wkhtmltopdf: why it prints in mobile view?

Created on 17 Jun 2017  路  3Comments  路  Source: wkhtmltopdf/wkhtmltopdf

Hi community!

We have a problem with this piece of code:

pdfkit.from_url("http://www.cubaempleo.com", "out.pdf")

This is the view of the web page:

page

This is the print result:

out

As you can see: the print result of the website with wkhtmltopdf it is as if it had been from a mobile device. Why? I'm missing a parameter for wkhtmltopdf or is it a website style problem?

Thanks!

NeedInfo

Most helpful comment

You need to set the view port size on your command to render desktop version.
wkhtmltopdf --viewport-size 1280x1024 http://theseasonslaithieu.com test.pdf

All 3 comments

You need to set the view port size on your command to render desktop version.
wkhtmltopdf --viewport-size 1280x1024 http://theseasonslaithieu.com test.pdf

Greats! Work for me! Thanks so much! 馃憤

You are welcome :) Please close this ticket to mark it resolved :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

8176135 picture 8176135  路  3Comments

ghost picture ghost  路  4Comments

dhughesbc picture dhughesbc  路  4Comments

nixilb picture nixilb  路  3Comments

monejava picture monejava  路  4Comments