pdfkit (for python) - scale output to fit in single A4 pdf page
Asked Answered
P

0

8

I'm using pdfkit Python libraries to convert an html page to pdf.

All I'm doing is using the command:

pdfkit.from_file('mypage.html', 'output.pdf')

The problem is that I obtain a multiple-page pdf, whereas I'd like to have everything on one page. How can I force pdfkit to shrink/scale the web page to fit on a regular A4 page? The webpage is locally saved on my PC, so I could also act on the html, if needed. Is there a way to "rescale" a web page at once?

Thank you!

Pepper answered 3/3, 2016 at 15:32 Comment(1)
It's a shame this hasn't been answered. As an alternative, I'd like page size to be scaled to fit into 1 page (rather than shrinking content).Clatter

© 2022 - 2024 — McMap. All rights reserved.