PDF Generating Tool Support Forum

HOME   Login   Register    Search




  Subject: CJK glyphs not displaying correctly
   PostPosted: 25 Jun 2020, 13:45 
Hi pd4ml,

We need to display CJK glyphs in PDF. We have created the JAR with the required fonts. It is working fine but having 2 issues:

1. The rendering of CJK Fonts is inconsistent. The pdf displays blank text after some conversions which is a random behavior. We added Thai fonts also which seem to work fine.
2. Bold CJK characters are not supported (Added font\ Bold in .properties file). As per pd4ml cookbook :
"If there is no matching substitution, PD4ML emulates missing styles. Italic is emulated by an area tilt, Bold is by a font glyph stroke out."

Can you please look into it and provide me any insight ?

Thanks,
Aman.


  Subject: Re: CJK glyphs not displaying correctly
   PostPosted: 25 Jun 2020, 15:11 
Is it necessary to have font face in HTML code because as per my understanding, pd4ml will match the ttf files for necessary glyphys and use them.. Please correct me if I am wrong..


  Subject: Re: CJK glyphs not displaying correctly
   PostPosted: 25 Jun 2020, 15:54 
In the ideal case, there is a direct match between all font faces used in HTML/PDF and font faces, listed in pd4font.properties. If HTML refers to a not mapped font - PD4ML tries to find a "similar" fonts among available ones (mentioned in the fallback tables). Thee fallback tables can be found in the post comments:

html-css-to-pdf-rendering-issues-f3/facing-different-rendering-issues-after-upgrading-pd4ml-lib-t1521.html

There is another issue with CJK fonts: not all of them define full range of glyphs (or some of glyphs are defined a way, not supported by Java or PD4ML).

I would recommend:
1. Use the most recent v3.11.4fx1 or newer
2. Temporarily add 'Arial Unicode MS' to see if it solves issues with the blank texts
3. Enable debug info and inspect STDOUT/server's log to see what happens with the font lookup.


  Subject: Re: CJK glyphs not displaying correctly
   PostPosted: 25 Jun 2020, 16:52 
@pd4ml, thanks for the reply. Please answer a quick question, is it necessary to define a font face in the HTML code? Currently we are not defining font-face in the HTML being converted to PDF for CJK.


  Subject: Re: CJK glyphs not displaying correctly
   PostPosted: 25 Jun 2020, 16:59 
You may omit font family/face definition.

If font face not explicitly defined in an input document, it takes the default face (Arial or Times New Roman) from the built-in stylesheet.


  Subject: Re: CJK glyphs not displaying correctly
   PostPosted: 29 Jun 2020, 09:10 
Hi @pd4ml,

Replying to your suggestions,
1. We are using 4.0.4 version for pd4ml.
2. Added the suggested font, but no progress.
3. Enabled the debugInfo() but it is not printing (debug level logs are enabled in server log4j configs).


  Subject: Re: CJK glyphs not displaying correctly
   PostPosted: 29 Jun 2020, 14:57 
> 1. We are using 4.0.4 version for pd4ml.
> 2. Added the suggested font, but no progress.

Try the most recent v4.0.8

> 3. Enabled the debugInfo() but it is not printing (debug level logs are enabled in server log4j configs).

In v4 the right API call is pd4ml.setLogLevel(255), where 255 is a bit mask with all options on.


  Subject: Re: CJK glyphs not displaying correctly
   PostPosted: 30 Jun 2020, 09:44 
There is no setLogLevel() method in 4.0.4 version. Can you please cross check and verify here..


  Subject: Re: CJK glyphs not displaying correctly
   PostPosted: 30 Jun 2020, 15:05 
PD4ML v4 has two PD4ML classes: com.pd4ml.PD4ML is the new API, org.zefer.pd4ml.PD4ML is PD4ML v3 API wrapper, which translates older API calls to the new ones.

setLogLevel() belongs to the new API. If you use the wrapper class, switch debug on with pd4ml.enableDebugInfo()


  Subject: Re: CJK glyphs not displaying correctly
   PostPosted: 02 Jul 2020, 11:43 
We have removed .ttc from the Fonts Jar and introduced .ttf Files instead.
Now the conversion works perfectly fine for the first few conversions, after which the converted PDF shows the following inconsistency for the HTML Given below:

Code:
Simplified - Chinese - <font face="KaiTi">人人生而自由,在尊严和权利上一律平等。</font>
Traditional - Chinese - <font face="MingLiU">人人生而自由,在尊嚴和權利上一律平等。</font>


Converted pdf shows KaiTi font being used for Traditional Chinese although the Font face says MaingliU.

Note: Both font mapping are present in .properties file and the Jar has the .ttf files. It works fine for the first few conversions after which the issue starts to come up although no code changes are made to the HTML file or CSS.

If I take a restart for the server, things start to work fine again until the inconsistency is again observed. Is there is any incorrect caching or wrong indexing of font file going on ?



[Reply]     [ 13 posts ]  Go to page 1, 2  Next

cron
Copyright ©2004-10 zefer|org. All rights reserved. Bookmark and Share