我们使用wkhtmltopdf从HTML页面呈现PDF,但是Verdana和乔治亚等字体不能正确显示。我们使用these指令在服务器上安装了TrueType字体。字体使用样式标签进行内联设置: style="font-family:宋体,日内瓦;
任何建议,我们可以尝试下一步,让这些字体显示,将不胜感激。
发布于 2013-06-07 05:15:38
试试Arman H.在这个问题上发布的解决方案:Google Web Fonts and PDF generation from HTML with wkhtmltopdf
将字体编码到css中的Base64对我们来说很有吸引力。
发布于 2013-01-23 05:21:11
你的css中的字体设置正确了吗?
例如:
@font-face {
font-family: 'Verdana';
src: url('verdana-webfont.eot');
src: url('verdana-webfont.eot?#iefix') format('embedded-opentype'),
url('verdana-webfont.woff') format('woff'),
url('verdana-webfont.ttf') format('truetype'),
url('verdana-webfont.svg#Verdana') format('svg');
font-weight: normal;
font-style: normal;
}发布于 2019-04-04 18:28:22
我不确定这是否适用于这个问题,但我通过安装true type字体解决了我的问题。之后,wkhtmltopdf就可以显示这些字体了。
Ubuntu (18.04)
apt install fonts-droid-fallback ttf-dejavu fonts-freefont-ttf fonts-liberation ttf-ubuntu-font-family高山Linux (3.9)
apk add ttf-dejavu ttf-droid ttf-freefont ttf-liberation ttf-ubuntu-font-familyhttps://stackoverflow.com/questions/14467820
复制相似问题