wkhtmltopdf 0.12.4(带修补的qt)字符已断开,svg字体已转换为图像

wkhtmltopdf 0.12.4(带修补的qt)字符已断开,svg字体已转换为图像,pdf,fonts,wkhtmltopdf,Pdf,Fonts,Wkhtmltopdf,抱歉,出现另一个wkhtmltopdf字体主题。 我正在尝试使用WKTHLTOPDF转换使用自定义字体的HTML页面: exec('/home/camelot/bin/wkhtmltopdf --orientation portrait --encoding utf-8 --page-size A4 --disable-smart-shrinking -T 0 -B 0 -L 0 -R 0 bill.html bill6.pdf '); ... @font-face { font

抱歉,出现另一个wkhtmltopdf字体主题。 我正在尝试使用WKTHLTOPDF转换使用自定义字体的HTML页面:

exec('/home/camelot/bin/wkhtmltopdf --orientation portrait --encoding utf-8 --page-size A4 --disable-smart-shrinking -T 0 -B 0 -L 0 -R 0 bill.html bill6.pdf ');

...

@font-face {
      font-family: 'camelot';
      src: url('gbcamweba-webfont.eot');
      src: url('gbcamweba-webfont.eot?#iefix') format('embedded-opentype'),
           url('gbcamweba-webfont.woff') format('woff'),
           url('gbcamweba-webfont.ttf') format('truetype'),
           url('gbcamweba-webfont.svg#camelotregular') format('svg');
      font-weight: normal;
      font-style: normal;
    }
不幸的是,生成的PDF中有一些字符被破坏:

我已经认识到,当仅使用自定义字体的svg版本时,形状会正确呈现,但类型也会转换为图像

您知道我是否可以使用SVG字体而无需将其转换为图像,或者如何实现正确的字体渲染吗

  • wkhtmltopdf 0.12.4
  • centos 6.9
  • 尝试使用base64编码类型
  • 试图在centos中安装字体
  • 尝试了旧版本0.9和0.10

    • 我就是这样解决的:


      仅使用OTF格式,无论字体是在centos中安装还是通过字体面加载。使用otf,字体将正确显示并保持键入状态。

      这很有效!我希望我能付给你一杯啤酒;)此外,之前我已经确定,通过使用链接到QT5而不是QT4的版本可以解决问题,但这在我们的生产环境中不是一个选项。对我来说,一个类似的解决方案奏效了:只需尝试(Windows)系统上的不同字体,尽管它们似乎不是OTF格式。