Good day!
I'm creates PDF docs from HTML using wkhtmltopdf library. I used svg font according to this issue wkhtmltopdf custom font letter spacing
I used custom font, added it by @font-face. All works fine for me, except one thing: text-align: justify is not working for some reason.
In html text is aligned as expected, but not in PDF.
Is anyone know how to fix this issue?
UPD: Added CSS and HTML example
<style type="text/css"> @font-face{ font-family:'source_sans_prolight'; src: url('/font/sourcesanspro-light-webfont.svg') format('svg'); font-weight:normal; font-style:normal; } @font-face{ font-family:'Source Sans Regular'; src: url('/font/sourcesanspro-regular-webfont.svg') format('svg'); font-weight:normal; font-style:normal; } html, body, p, ul, li, span, img { margin: 0px; padding: 0px; } body { font-family: "Source Sans Regular", sans-serif; text-rendering: geometricPrecision; } .page { width: 729px; } .block { width: 300px; float: left; margin-right: 40px; text-align: justify; } </style> <div class="page"> <div class="block">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque fermentum iaculis mollis. Cras in varius lectus. Mauris consequat vestibulum dolor pretium pulvinar.</div> <div class="block">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque fermentum iaculis mollis. Cras in varius lectus. Mauris consequat vestibulum dolor pretium pulvinar.</div> </div>
HTML renders as expected: http://i.imgur.com/hE3xYxt.png
And in PDF I got this: http://i.imgur.com/S3KAPqg.png