mileszs / wicked_pdf

PDF generator (from HTML) plugin for Ruby on Rails
http://www.mileszs.com/wicked-pdf-plugin
MIT License
3.54k stars 646 forks source link

Deformed font rendering on Heroku #702

Open douglasep opened 6 years ago

douglasep commented 6 years ago

I've tried to do some pdf files. In Heroku it does not work properly. In the debug mode is working well, and in localhost too.

When I generate a pdf in Heroku the border of the fonts does not render properly, the rounded parts become deformed.

I'm using the gem wkhtmltopdf-heroku What can it be? 29.pdf

douglasep commented 6 years ago

wkhtmltopdf is cutting off the bottom of the letters. I really needed to fix it

unixmonkey commented 6 years ago

Also relates to: #469, #509, #674

Some fonts are just going to render differently across different systems, and a Linux font with the same name is likely a different version. Try installing that font specifically on the server, or loading it via a web-font resource.

Also try setting zoom: 1.3 or around that value. I've heard that sometimes works for this kind of deformation.

Try loading your site on a Linux desktop, and you'll probably spot font rendering differences sooner.

There is a good breakdown of the problem and many good suggestions in this thread/issue that may help: wkhtmltopdf/wkhtmltopdf#45

SeriouslyAwesome commented 5 years ago

A bit late to this thread, but for others stumbling in here via Google, this seems to be an issue with Heroku's heroku-18 stack and wkhtmltopdf. Reverting to heroku-16 solved the issue for me.

v2lrf commented 5 years ago

A bit late to this thread, but for others stumbling in here via Google, this seems to be an issue with Heroku's heroku-18 stack and wkhtmltopdf. Reverting to heroku-16 solved the issue for me.

Thanks for this feedback 🙏🏼 and your solution @SeriouslyAwesome

And for whom it may ride faster the problem here the command line

heroku stack:set heroku-16

then commit something and push again to heroku... more about your stack keroku doc