0

Using "wkhtmltopdf" as a PDF generator, and CKeditor as a Wysiwig editor, the font-size looks different between what I see in my browser, and what is shown in the PDF.

I tried many things: changing the font-size to cm/px/pt, changing the font-size percentage on the body ... but I can't find a way to have the same look in my HTML editor and in my PDF.

Is there some kind of link between PDF font-size and html one's ? Is the output in a PDF smaller than the one in a browser ? Does someone already managed to obtain the same look in a WebBrowser than in a PDF using those kind of PDF generation tool ?

4

1 回答 1

0

我找到了一个令人满意的解决方案。

我尝试使用@font-face 导入字体,但这对我不起作用,因为wkhtmltopdf 无法识别每个“样式”(斜体、粗体、粗体+斜体)的多个@font-face。我必须使用我的 Windows 系统和 Linux 服务器上可用的“免费”字体(在我的情况下为“DejaVu Sans”),并且在系统生成 PDF 时直接可用。

这两种字体现在在我的 Wisywig 和生成的 PDF 之间呈现类似的效果。我还必须使用许多 CSS 规则来使其干净,删除 PNG 图像……但那是另一回事了。

于 2013-09-20T10:15:09.563 回答