HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › HTML/CSS rendering issues › Header is ok, body is failing showing question marks
- This topic has 6 replies, 3 voices, and was last updated Dec 13, 2016
04:30:36 by coolazice.
-
AuthorPosts
-
December 7, 2016 at 02:37#27115
Hi,
we are using the pd4ml to convert html with chinese characters.
we have chinese characters in both the header and the body. the outcome is that
1. the header shows the chinese characters correctly in the PDF
2. however, for the body all chinese characters are rendering as question marks (?).we know that we are loading the correct font as due to the header being rendered correctly. We are scratching our heads as to why only the body is failing from time to time.
the problem arises intermittently as well however same observations as per above.
Anybody knows any known issue relating to the above?
December 7, 2016 at 11:25#29972It sounds like different font families are applied to the header content and to the main body.
If, for example, Arial or Times is applied to Chinese text (and regular versions of the fonts do not define CJK glyphs) PD4ML scans its fallback tables to find a “similar” font, which is able to display a given text. If no suitable font found, it gives up with an output of question marks.
I guess it succeeds with a substitution font for header, but not for the main content. If you switch debug on, it should dump the font lookup attempts.
December 7, 2016 at 16:31#29973Thanks for the reply
For reference, we are loading “arialuni.ttf” to the pd4ml.
We will turn the debug mode one and wait to for it to occur again.
We use the same chinese characters for both header and body html and assuming that substitution is only failing for the body given that we load only the arialuni.ttf
What would likely be the solution to resolve such an issue?
December 8, 2016 at 04:08#29974Hi,
We have enabled debug, though it only shows the lookup on first load.. succeedingly it doesnt show already (weblogic). I dont think it will be beneficial to enable debug as it will not show lookup once issue occurs.
BTW Additional Information:
pd4ml properties file contains:
Arial=arialuni.ttf
Serif=arialuni.ttf
Times New Roman=arialuni.ttfFont File name: ARIALUNI.TTF
Questions:
Is my properties file sufficient to render chinese characters?
We dont add the meta tag for the charset encoding of the HTML that will be converted, is it critical in using CJK Glyphs?December 8, 2016 at 14:32#29975Try to add
SimSun=arialuni.ttf
SimSun presents in all fallback tables, so a TTF behind the font family name should be used as the last resort.
December 12, 2016 at 09:46#29976Hi
We were able to partially recreate the problem.
We did stress test to generate 100 pdfBy the 35th and 36th generation the error occured to the PDF and stabilized again.
The 2 files (35th and 36th) had problem rendering chinese as its showing as question mark.
We will try to apply the suggestion but feel free to advise if have an explanation on what happened. Thanks!
December 13, 2016 at 04:30#29977Hi,
I attached a sample of the problem we were able to recreate by chance.
As you can see, some are rendered as question marks, some are corrrectly rendered in chinese.additionally this does not happen frequently. most of the time everything is in order (rendering).
our working hypothesis that if the server slows down due to usage it affects the rendering.
Is there any solution that can resolve this?
We have our doubts on adding a new font in the properties file will work:SimSun=arialuni.ttf
appreciate on any advise on the matter. thanks!
-
AuthorPosts
The forum ‘HTML/CSS rendering issues’ is closed to new topics and replies.