|
Rank: Member Groups: Member
Joined: 10/17/2013 Posts: 22
|
Hi,
When using EoPdf in K8s (Windows) to render HTML, All Asian characters are missing and shown as blank squares. When running EoPdf in regular windows environment it works.
Is your application cloud native? What can I do to solve it?
Thanks, Yossi
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
EO.Pdf uses Windows' own font API (DirectWrite) to get font data and manages font fallbacks. So when the fonts are not rendered, it's because EO.Pdf can not "see" those fonts, so you can check the content's of Windows\Fonts folder first.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 10/17/2013 Posts: 22
|
Hi,
How can I get from EoPdf the names of the fonts he can not "see"?
Thanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
This is just whatever font you are trying to use and not rendered correctly. When it does not render correctly, it's almost always because those font do not exist in your system.
Thanks
|
|
Rank: Member Groups: Member
Joined: 10/17/2013 Posts: 22
|
Hi,
I'm not trying to use a specific font. The HTML contains CJK characters, and the browser knows which default font to use in order to display them correctly.
It works fine when using EoPDF on windows machine which contains CJK fonts.
When we use EoPDF in a container we see the blank squares. Since they are not installed on the container the characters are blank.
I assume the fonts should be embeded in the PDF, am I right? If yes, does EoPdf tries to find a default font? If it fails can I get the font name it looked for?
Thanks,
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
EO.Pdf does try to find a default fallback font. However since you are seeing squares, that means the fallback has failed too (the fallback font does not have the specific CJK characters, which is common since almost all Western fonts do not have these characters). This part does not have anything to do with EO.Pdf ---- the fallback mechanism is done by Windows.
For performance reason, EO.Pdf does not report to you which font is missing or failed to fallback. It simply renders the NODEF symbol (not defined, typically rendered as square). However you can open the PDF file with a text editor and search for /BaseFont and you will see the font name being used. You won't be able to tell exactly which font has all the data and which font does not without an indepth understanding of PDF/font file format, but you that should give you a starting point as to which font to look for. You can also run the conversion normally on a desktop system (so that every font is rendered correctly), then open the file with Adobe Reader, then go to File -> Properties -> Font to get a list of fonts used.
Once you find out what font you use, you can either install those fonts in your system, or host those font file somewhere and then use @font-face CSS directive to reference them in your page. Obviously the later option may require you to modify your input HTML file (you may be able to apply them without modifying your HTML file through HtmlToPdf.Options.UserStyleSheet, but that still requires you knowing the content of your HTML file in order for the style to apply correctly).
Hope this helps.
Thanks!
|
|