letter-spacing is too large with wkhtmltopdf

后端 未结 9 1094
情书的邮戳
情书的邮戳 2021-02-06 07:30

I\'m using wkhtmltopdf to download a webpage as pdf.

But the css property letter-spacing seems doesn\'t work

font-size:20px; letter-spacing:0px;
<         


        
相关标签:
9条回答
  • 2021-02-06 07:54

    We faced the same problem. One workaround is to set the dpi flag to 96.

    As setting the DPI to such a low value (print usually uses at least 300) resulted in blurry images, we tried to use SVG font files, which did the trick.

    0 讨论(0)
  • 2021-02-06 07:59

    letter-spacing is broken in wkhtmltopdf.
    But i found other ways around for kerning:

    1. You may set position for every letter. Kerning is used for headings so there are not so much letters usually.

    2. You may alter the font file and set the custom kerning you want. Usually it would be enough to alter latin letters. I've tested this and it worked well. Used FontForge (http://fontforge.github.io/) for this. But may be there is a more convenient software.

    0 讨论(0)
  • 2021-02-06 08:02

    Its a known issue. https://github.com/wkhtmltopdf/wkhtmltopdf/issues/1575 . No fix for it. Only to avoid using letter-spacing

    0 讨论(0)
提交回复
热议问题