wkhtmltopdf reduces font size too much with smart shrinking enabled, enlarges it with --disable-smart-shrinking parameter

1,565 views
Skip to first unread message

Qasim Lodhi

unread,
Sep 6, 2016, 8:47:00 PM9/6/16
to wkhtmltopdf General
I'm using wkhtmltopdf "0.12.3 (with patched qt)" on Mac OS 10.11.1.

I have a simple "Hello, World!" HTML with 6 pt size defined in style attribute of div. When I run wkhtmltopdf without any parameters (other than I/O files), the generated PDF gets a size of 6.14pt instead of 6pt. If I use --disable-smart-shrinking (with no zoom), the size goes to 7.68pt. I expect font size to stay at 6pt when using --disable-smart-shrinking option.

<html>
<head/>
<body>
<div id="text" style="font-family: Arial; font-size: 6pt;">
Hello, World!
</div>
</body>
</html>

$> wkhtmltopdf file:///temp/fontTest.html /temp/fontTest.pdf


In my real HTML I have more stuff and the font size variation is 6pt -> 5.76pt with --disable-smart-shrinking and zoom 0.75188. This change in font size is not linear with change in zoom otherwise I could have figured out a "good" zoom number.

I've also tried with different values of --dpi with no luck. I suspect that it's got something to do with dpi...?

Anyone got any ideas on this one?

Thanks.
Reply all
Reply to author
Forward
0 new messages