wkhtmltoimage generate image flie but can not show chinese character but pdf can

user1811937 picture user1811937 · Nov 9, 2012 · Viewed 13.3k times · Source

I used wkhtmltoimage to generate image, then I input command

  1. wkhtmltoimage http://www.baidu.com/tmp/screenshot.jpg

  2. wkhtmltopdf http://www.baidu.com/tmp/screenshot.pdf

The result is Chinese character could not show.

The version:

wkhtmltopdf   wkhtmltopdf 0.9.6
wkhtmltoimage  wkhtmltoimage 0.11.0 rc1

Can anyone help me? Any help will be appreciated;

Answer

NallaN picture NallaN · May 13, 2013

it looks like you are trying to use the wkhtmlto_ programs as OCR - your commands above are trying to turn an image into an image and a pdf to a pdf.

This is a command i use on a windows project I have worked on to do this:

wkhtmltoimage --encoding "utf8" --quality 100 --zoom 1.4 --crop-w 816 C:/.../public/temporary/temp.html C:/.../public/temporary/temp.jpg

note the --encoding "utf8" in my command. Hope this helps!