PDF Generating Tool Support Forum

HOME   Login   Register    Search




  Subject: Issue after v3.10.6 pro upgrade, need support
   PostPosted: 25 Aug 2018, 08:22 
Hi ,
We are facing the issue of special characters when text is in hebrew/Arabic/chinese in generating pdf where as in browser these text is shown correctly.

We are currently on pd4ml 3.7 where we do not see this issue and we wanted to upgrade to 3.10.6 and has pro licence where we see this issue and this issue is blocking our upgrade.

We tried with the solution suggested in this thread as shown below, but it does not seems to work.

pd4ml.render(new StringReader(htmlStr), outputStream, new URL(baseURL),"UTF-8")

Is there a change from v3.7 to v3.10.6,how do we solve this issue?

Logs while generating pdf in both the version.
hope this helps :
****************************************************************
From Logs
v3.7 - where there is no issue :

[log4j2] 16:11:45,274 INFO [STDOUT] [0:0:0:0:0:0:0:1] [73] [kk] version: PD4ML 370 Pro
[log4j2] 16:11:45,537 INFO [ZKFactory] Zookeeper state change to :LOST
[log4j2] 16:11:46,284 INFO [ZKFactory] Zookeeper state change to :SUSPENDED
[log4j2] 16:11:47,246 INFO [STDOUT] [0:0:0:0:0:0:0:1] [73] [kk] not yet in cache: java:/content/pd4fonts.properties
[log4j2] 16:11:47,859 INFO [ZKFactory] Zookeeper state change to :LOST
[log4j2] 16:11:47,919 INFO [STDOUT] [0:0:0:0:0:0:0:1] [73] [kk] 'serif' is not in pd4fonts.properties file
[log4j2] 16:11:47,919 INFO [STDOUT] [0:0:0:0:0:0:0:1] [73] [kk] reject TTF lookup for: 'serif'
[log4j2] 16:11:47,920 INFO [STDOUT] [0:0:0:0:0:0:0:1] [73] [kk] not yet in cache: java:/content/ARIALUNI.TTF
[log4j2] 16:11:48,509 INFO [ZKFactory] Zookeeper state change to :SUSPENDED
[log4j2] 16:11:48,748 INFO [ZKFactory] Zookeeper state change to :LOST
[log4j2] 16:11:49,612 INFO [ZKFactory] Zookeeper state change to :SUSPENDED
[log4j2] 16:11:49,641 INFO [STDOUT] [0:0:0:0:0:0:0:1] [73] [kk] read 'arial unicode ms' from java:/content/ARIALUNI.TTF
[log4j2] 16:11:51,300 INFO [STDOUT] [0:0:0:0:0:0:0:1] [73] [kk] done in 6474ms.



************************************************************
From Logs
v3.10.6 - where we see the issue :

[log4j2] 11:32:40,821 INFO [PD4MLHTML2PDFConverter] [0:0:0:0:0:0:0:1] [549] [kk] PD4ML Version is: 3106 Pro DMS
[log4j2] 11:32:40,905 INFO [STDOUT] [0:0:0:0:0:0:0:1] [549] [kk] version: PD4ML 3106 Pro DMS
[log4j2] 11:32:41,167 INFO [ZKFactory] Zookeeper state change to :LOST
[log4j2] 11:32:41,213 INFO [STDOUT] [0:0:0:0:0:0:0:1] [549] [kk] not yet in cache: java:/content/pd4fonts.properties
[log4j2] 11:32:41,228 INFO [STDOUT] [0:0:0:0:0:0:0:1] [549] [kk] loading java:/content/pd4fonts.properties [11ms]
[log4j2] 11:32:41,484 INFO [ZKFactory] Zookeeper state change to :SUSPENDED
[log4j2] 11:32:41,758 INFO [ZKFactory] Zookeeper state change to :LOST
[log4j2] 11:32:42,204 INFO [STDOUT] [0:0:0:0:0:0:0:1] [549] [kk] 'serif' is not in pd4fonts.properties file
[log4j2] 11:32:42,204 INFO [STDOUT] [0:0:0:0:0:0:0:1] [549] [kk] reject TTF lookup for: 'serif'
[log4j2] 11:32:42,205 INFO [STDOUT] [0:0:0:0:0:0:0:1] [549] [kk] 'times new roman' is not in pd4fonts.properties file
[log4j2] 11:32:42,205 INFO [STDOUT] [0:0:0:0:0:0:0:1] [549] [kk] reject TTF lookup for: 'times new roman'
[log4j2] 11:32:42,205 INFO [STDOUT] [0:0:0:0:0:0:0:1] [549] [kk] 'ms mincho' is not in pd4fonts.properties file
[log4j2] 11:32:42,206 INFO [STDOUT] [0:0:0:0:0:0:0:1] [549] [kk] reject TTF lookup for: 'ms mincho'
[log4j2] 11:32:42,206 INFO [STDOUT] [0:0:0:0:0:0:0:1] [549] [kk] 'mingliu' is not in pd4fonts.properties file
[log4j2] 11:32:42,206 INFO [STDOUT] [0:0:0:0:0:0:0:1] [549] [kk] reject TTF lookup for: 'mingliu'
[log4j2] 11:32:42,206 INFO [STDOUT] [0:0:0:0:0:0:0:1] [549] [kk] 'simsun' is not in pd4fonts.properties file
[log4j2] 11:32:42,207 INFO [STDOUT] [0:0:0:0:0:0:0:1] [549] [kk] reject TTF lookup for: 'simsun'
[log4j2] 11:32:42,207 INFO [STDOUT] [0:0:0:0:0:0:0:1] [549] [kk] 'mangal' is not in pd4fonts.properties file
[log4j2] 11:32:42,209 INFO [STDOUT] [0:0:0:0:0:0:0:1] [549] [kk] reject TTF lookup for: 'mangal'
[log4j2] 11:32:42,209 INFO [STDOUT] [0:0:0:0:0:0:0:1] [549] [kk] 'david' is not in pd4fonts.properties file
[log4j2] 11:32:42,209 INFO [STDOUT] [0:0:0:0:0:0:0:1] [549] [kk] reject TTF lookup for: 'david'
[log4j2] 11:32:42,210 INFO [STDOUT] [0:0:0:0:0:0:0:1] [549] [kk] 'batang' is not in pd4fonts.properties file
[log4j2] 11:32:42,210 INFO [STDOUT] [0:0:0:0:0:0:0:1] [549] [kk] reject TTF lookup for: 'batang'
[log4j2] 11:32:42,210 INFO [STDOUT] [0:0:0:0:0:0:0:1] [549] [kk] 'lucida sans regular' is not in pd4fonts.properties file
[log4j2] 11:32:42,212 INFO [STDOUT] [0:0:0:0:0:0:0:1] [549] [kk] reject TTF lookup for: 'lucida sans regular'
[log4j2] 11:32:42,212 INFO [STDOUT] [0:0:0:0:0:0:0:1] [549] [kk] 'ms gothic' is not in pd4fonts.properties file
[log4j2] 11:32:42,212 INFO [STDOUT] [0:0:0:0:0:0:0:1] [549] [kk] reject TTF lookup for: 'ms gothic'
[log4j2] 11:32:42,213 INFO [STDOUT] [0:0:0:0:0:0:0:1] [549] [kk] 'gulim' is not in pd4fonts.properties file
[log4j2] 11:32:42,213 INFO [STDOUT] [0:0:0:0:0:0:0:1] [549] [kk] reject TTF lookup for: 'gulim'
[log4j2] 11:32:42,213 INFO [STDOUT] [0:0:0:0:0:0:0:1] [549] [kk] 'gulimche' is not in pd4fonts.properties file
[log4j2] 11:32:42,213 INFO [STDOUT] [0:0:0:0:0:0:0:1] [549] [kk] reject TTF lookup for: 'gulimche'
****************************************************************


  Subject: Re: Issue after v3.10.6 pro upgrade, need support
   PostPosted: 27 Aug 2018, 21:51 
From the log I can see, the fonts are configured to be loaded via the classloader (for example, from fonts.jar)

v3.7 successfully loads the fonts, but for some reason 3.10 does not.

Is the JAR with fonts is in the classpath (or in application lib/ folder) in both cases?


  Subject: Re: Issue after v3.10.6 pro upgrade, need support
   PostPosted: 29 Aug 2018, 08:00 
We are not using Fonts.jar
We have pd4fonts.properties file to load fonts.

This is the piece of code we have, which works fine with v3.7 not with v3.10
pd4ml.useTTF(PD4ML_TTF_FONT_PATH, true);
pd4ml.setDefaultTTFs(PDFRenderingOptionsBean.DEFAULT_SERIF_TTF_FONT,
PDFRenderingOptionsBean.DEFAULT_SANSSERIF_TTF_FONT,
PDFRenderingOptionsBean.DEFAULT_MONOSPACE_TTF_FONT);


  Subject: Re: Issue after v3.10.6 pro upgrade, need support
   PostPosted: 29 Aug 2018, 17:21 
In the log there is a line, that it tries to load font mapping file from
java:/content/pd4fonts.properties

That means there is somewhere a Java line
pd4ml.useTTF("java:/content", true);

BTW, what is PD4ML_TTF_FONT_PATH value?

If you do not use fonts.jar it can be the fonts are bundled with your application: there is "/content" folder in your application JAR or classes dir.

I would recommend to temporarily stop the debug of fonts loading via classpath and to focus on the corrupted texts.

Find where the TTF fonts of your application located, copy them to a temporal location (i.e. c:/temp/fonts) including pd4fonts.properties and point to the folder from your application:
pd4ml.useTTF("c:/temp/fonts", true);

Check the debug output if it loads the fonts from there.


  Subject: Re: Issue after v3.10.6 pro upgrade, need support
   PostPosted: 29 Aug 2018, 21:22 
Yes you are right, the value of PD4ML_TTF_FONT_PATH = "java:/content".
Will have a look at your recommendation and get back.

Thanks,
Kishore



[Reply]     [ 5 posts ] 

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