Wkhtmltopdf paragraph text shrinks with large images on content, please help

359 views
Skip to first unread message

Joel Peltonen

unread,
Sep 13, 2012, 8:04:07 AM9/13/12
to wkhtmltop...@googlegroups.com
Greetings!

My generated PDF shrinks the text of my paragraphs when a large picture is present on the page. I believe that this is due to WK trying to fit the image on the page even though it is too big, so the text is thus scaled down so that the image would fit. Disabling smart shrinking doesn't fix this and enabling smart shrinking only very slightly improves it.

This is a big issue when I sometimes need A4 and A5 prints from the same source and the A5 text is unreadable. Could anyone help me; is there a solution or a workaround to this problem? I have full control over the HTML/CSS/JS of the content to be converted.

My source HTML is a simple example with:

 
<html><head>
<style language="text/css">* {border: 1px solid cyan;}</style>
</head><body>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc congue gravida orci a venenatis. Aliquam sagittis neque id mi aliquam porttitor. Integer ut mauris ante. Etiam iaculis ullamcorper ipsum sit amet tincidunt. Donec tellus magna, hendrerit ac porttitor sed, ornare sed nibh. Vestibulum ac eros dui, eget tempus arcu. Quisque consequat viverra nisl vel auctor. Sed lorem mi, hendrerit at consectetur at, viverra et nisi. Donec tincidunt eros mattis erat ullamcorper bibendum. Fusce commodo convallis est nec dictum</p>
<p><img alt="" src="Content.JPG" style="width:800px;"></p>
</body></html>

My commands

wkhtmltopdf.exe --disable-smart-shrinking --zoom 1 --page-size A5 ptest.html a5.pdf
wkhtmltopdf.exe --disable-smart-shrinking --zoom 1 --page-size A4 ptest.html a4.pdf

Many thanks for any advice regarding this issue!

- Joel 

Message has been deleted

ddy...@gmail.com

unread,
Oct 14, 2016, 5:41:35 PM10/14/16
to wkhtmltopdf General, joel.p...@gmail.com
Same problem here...4 years later! Anyone? :)
Reply all
Reply to author
Forward
0 new messages