Happened across wkhtmltopdf, and it looked interesting, as I've been playing with generating PDFs from HTML using various PDF printer programs.
One of the issues of the samples I've been playing with is that there are lines composed of discontinuous segments, which the browsers render fine on screen, but when they print, either their print function or the PDF printer capture function rounds something or another, and winds up with little gaps in the lines where they should abut. I was highly encouraged to discover that wkhtmltopdf produces PDF files without this artifact.
On the other hand, of the 4 fonts I used in the sample, one was omitted entirely, and the other replaced by boxes. So I'm wondering if there are general rules about what font types work with wkhtmltopdf and what font types do not.
The font that was turned into boxes was SimSun, a Chinese character font. (ships with Windows, so installed locally)
The font that was omitted entirely was Bravura, a free music font. Installed locally.
My CSS font-face directives have allowed proper function with the latest Firefox, Chrome, Opera, and IE 11.
I can provide a sample if needed, but if there is some basic incompatibility, maybe I'm just out of luck.
I didn't find any options to set that seemed directly related to fonts, but I did receive a warning that might be related, although it doesn't sound like it, particularly? The samples contain no iframes, and only 2 pages were produced. I haven't tried tweaking page sizes, etc., as yet, the sample was really supposed to be one page.
Loading pages (1/6)
QFont::setPixelSize: Pixel size <= 0 (0) ] 33%
Counting pages (2/6)
QFont::setPixelSize: Pixel size <= 0 (0)=====================] Object 1 of 1
Warning: Received createRequest signal on a disposed ResourceObject's NetworkAccessManager. This might be an indication of an iframe taking too long to load.
Resolving links (4/6)
Loading headers and footers (5/6)
Printing pages (6/6)
Done
Summary:
1) Are there restrictions on what types of web fonts work with wkhtmltopdf? All mine are .ttf except SimSun is .ttc; Bravura has postscript outlines, which seems to make a difference to some font handling systems.
2) Does wkhtmltopdf honor @media print CSS or does it use the default screen CSS?