wkhtmltopdf and font size shrinkage

10 September 2010   0 comments   Web development

Mind That Age!

This blog post is 8 years old! Most likely, its content is outdated. Especially if it's technical.

wkhtmltopdf is by far the best tool available to make PDFs. Yes. I have tried ReportLab and PISA. ReportLab might be more powerful but what you gain in fine-grained control you lose in hours and hours of productivity.

Anyway, I've learned something about font-size shrinkage and using wkhtmltopdf. Basically, if use percentage to change a font size (Arial in this case) you get a PDF where the letters are unevenly spaced between. It took me a while to figure out what the hell was going on until I changed the font-size from 90% to exactly 11px.

font-size: 90% ('font-size:90%'; the spots of red are my highlights of the ugly spacings)

font-size: 11px ('font-size:11px'; not perfect but much better)

So, at first I thought this was the first time wkhtmltopdf has disappointed me but I guess I'll just have to remember not to use percentages and continue to favor wkhtmltopdf as my choice of weapon in the PDF production world.

Comments

Your email will never ever be published


Related posts

Previous:
I just discovered wikiHow 08 September 2010
Next:
In jQuery, using the :visible selector can be dangerous 14 September 2010
Related by Keyword:
Convert web page to PDF, nicely 04 February 2018
Printer friendly and PDF version of every page 14 January 2004
PythonPoint 10 January 2004
Related by Text:
Be very careful with your add_header in Nginx! You might make your site insecure 11 February 2018
jQuery and Highslide JS 08 January 2008
I'm back! Peterbe.com has been renewed 05 June 2005
Anti-McCain propaganda videos 12 August 2008
I'm Prolog 01 May 2007