1
votes

I'm trying to get better looking Cyrillic output with wkhtmltopdf.

Any suggestions on how I can make the wkhtmltopdf output look more like how it looks in Chrome? In particular, I'd like to get the serifs and the fine detail that the Chrome rendering has.

Note: It's ok if I have to modify the test page with additional markup. I just want to get good looking Cyrillic output from an HTML document - not necessarily the test page.

Details:

wkhtmltopdf.exe http://www.alanwood.net/unicode/cyrillic.html output.pdf

Here is how the test page looks in Chrome:

Chrome rendering

and here is how the output of wkhtmltopdf looks when viewed with Chrome's PDF viewer:

wkhtmltopdf rendering

and here is how the output of wkhtmltopdf looks when viewed with Acrobat Reader:

as rendered by acrobat reader

1
What isn't working? Is it the default font?Blender
I'd like to get the serifs and the fine detail that the Chrome rendering has.ErikR
It might just be a case of explicitly specifying a certain font, but I wasn't able to determine which font Chrome is using.ErikR

1 Answers

0
votes

You can embed a high-quality Cyrillic font to get consistent output throughout. This is easily accomplished by Base64 encoding the font and including it in your CSS:

@font-face {
    font-family: 'PTSans';
    src: url(data:font/truetype;charset=utf-8;base64,AAEAAAATAQA...
}