【发布时间】:2012-06-22 10:26:18
【问题描述】:
有没有办法用 PDFKit 和自定义字体打印 pdf?
在 css 中我有:
@font-face {
font-family: 'ChaparralProRegular';
src: url("path_to_font/chaparralpro-regular-webfont.eot");
src: url("path_to_font/chaparralpro-regular-webfont.eot?#iefix") format("embedded-opentype"),
url("path_to_font/chaparralpro-regular-webfont.woff") format("woff"),
url("path_to_font/chaparralpro-regular-webfont.ttf") format("truetype"),
url("path_to_font/chaparralpro-regular-webfont.svg#ChaparralProRegular") format("svg");
以上代码在呈现为 html 时工作正常,但使用 PDFKit 打印到 pdf 时使用标准字体。 有什么线索吗?
【问题讨论】:
-
JFI 你是否提供了带有样式表的媒体屏幕,还有在
wkthmltopdf中附加样式表的选项以附加样式表我猜pdfkit 也支持它,是的,它确实kit.stylesheets << '/path_to_your_stylesheet
标签: ruby-on-rails pdfkit