Posts

Showing posts from April, 2015

wkHTMLToPDF chinese/japanese/korean character support on Linux based systems

This post will explain how to add support for Chinese or Japanese or Korean characters in wkHTMLToPDF - the famous tool that converts HTML pages to PDF documents seamlessly. By default, if you have Chinese characters in your HTML page and convert the page to PDF with wkHTMLToPDF, nothing comes out (blanks replace chinese characters). I doubt this subject will be helpful to a lot of people around the world, but I might need to use this trick again in the future so why not blog about it? The trick is to install Chinese character support on your OS and rebuild the cache. Under Ubuntu, I ran this command to install Chinese fonts: apt-get install fonts-wqy-microhei ttf-wqy-microhei fonts-wqy-zenhei ttf-wqy-zenhei  Note: package names might be different if you aren't under Ubuntu (try  apt-cache search  ... to search for packages) Then, run this command to update the font cache: fc-cache -f -v For Japanese and Korean please use those: https://help.ubuntu.com/community