PHP Classes

Poor output at small font sizes

Recommend this page to a friend!

      WKHTMLTOPDF HTML to PDF creator  >  All threads  >  Poor output at small font sizes  >  (Un) Subscribe thread alerts  
Subject:Poor output at small font sizes
Summary:Characters generated at small font sizes may have wrong spacing
Messages:1
Author:PHP-4-Business
Date:2012-04-11 08:24:33
 

  1. Poor output at small font sizes   Reply   Report abuse  
Picture of PHP-4-Business PHP-4-Business - 2012-04-11 08:24:33
There is a long-standing bug in the Webkit engine used by this class, which means that sometimes the text in the resulting pdf is rendered poorly when using small font sizes (e.g. <= 9 px). The kerning on some of the characters is wrong.

This can be fixed by forcing the engine to include the font within the generated PDF.

Simply put, include a font within your html to be converted using the font-face CSS rule. E.g.:

<style type='text/css'>
@font-face {
font-family: mysans; src: url('fonts/texgyreheros-regular.otf'); font-weight: normal; font-style: normal;
}
div, td, th {font-family: mysans;}
</style>


(more info:
code.google.com/p/wkhtmltopdf/issue ...
chmielot.blogspot.co.uk/2010/10/fon ...
)

 
For more information send a message to info at phpclasses dot org.