PDF Generating Tool Support Forum

HOME   Login   Register    Search




  Subject: PD4ML cannot access Times New Roman Font
   PostPosted: 30 Aug 2017, 10:39 
Hi,

We are facing a very strange behavior with PD4ML and JBOSS App server in our production environment. We are using custom fonts embedded within a jar file which is part of the app war deployable.

We have configured the below fonts in the pd4fonts.properties which is called by the java class using pd4ml.useTTF("java:defaultfonts", true);


Arial=arial.ttf
Arial\ Bold=arialbd.ttf
Arial\ Bold\ Italic=arialbi.ttf
Arial\ Italic=ariali.ttf
Courier\ New=cour.ttf
Courier\ New\ Bold=courbd.ttf
Courier\ New\ Bold\ Italic=courbi.ttf
Courier\ New\ Italic=couri.ttf
Times\ New\ Roman=times.ttf
Times\ New\ Roman\ Bold=timesbd.ttf
Times\ New\ Roman\ Bold\ Italic=timesbi.ttf
Times\ New\ Roman\ Italic=timesi.ttf
Calibri\ Bold=calibribd.ttf
Calibri=calibri.ttf
Calibri\ Italic=Calibrii.ttf
MingLiU=mingliu.ttc_0
Gill\ Sans=GillSansMT.ttf
Gill\ Sans\ Bold=GillSansMTBold.ttf
Gill\ Sans\ Bold\ Italic=GillSansMTBoldItalic.ttf
Gill\ Sans\ Italic=GillSansMTItalic.ttf
Gill\ Sans\ Light=GillSansMTLight.ttf
Gill\ Sans\ Semi\ Bold=GillSans-SemiBold.ttf
Gill\ Sans\ Condensed=GillSansMT-condensed.ttf
AdobeSongStd=AdobeSongStd.ttf
SharpSong=SharpSong.ttf

The issue is that we are seeing, in Production the fonts in the PDF generated are switching to AdobeSongStd.ttf instead of times.ttf. Once we restart the jboss by clearing the cache files (tmp and work folders in unix) the times.ttf is being used again which is the expected fonts. After a few random days, the fonts are going back to AdobeSongStd. Every time the jboss is restarted the fonts switch back to times.ttf.

I can see that Jboss is extracting these jar files having the fonts on to the tmp cache folder and I am assuming it then uses the fonts from there. However we are not able to understand why jboss/pd4ml is not using the times.ttf font and why it is using AdobeSongStd.ttf file instead. Also we do not know why the times.ttf is fetched properly when we do a jboss restart after clearing cache.

Can anyone please help me on this?


Attachments:
pd4ml_rc_jar.JPG
pd4ml_rc_jar.JPG [ 80.66 KiB | Viewed 333 times ]
  Subject: Re: PD4ML cannot access Times New Roman Font
   PostPosted: 06 Sep 2017, 13:13 
Hi Team,

Can you please help us on this issue? I have been looking at the issue posted at the below link and our issue somewhat resembles the one posted here.

But we still cannot figure out why restarting the JBOSS server brings the fonts back to Times New Roman.

html-css-to-pdf-rendering-issues-f3/issue-with-font-family-on-chinese-characters-t921.html


  Subject: Re: PD4ML cannot access Times New Roman Font
   PostPosted: 06 Sep 2017, 13:27 
What does it print (to STDOUT or server's log) if you switch debug mode on with pd4ml.enableDebugInfo()?


  Subject: Re: PD4ML cannot access Times New Roman Font
   PostPosted: 06 Sep 2017, 14:13 
Unfortunately since this is a PROD system, we do not have an option to do a enableDebugInfo() and cannot replicate the same in Dev or UAT

We have 3 servers with the same war file deployed and we see that this issue does not happen with all the 3 servers at the same time.

Can you please let us know if Jboss extracts the PD4ML font files from the war to any temp files?

Also why PD4ML is not fetching times font even though it is available and also why it is happening only sometimes and restarting jboss resolves it?


  Subject: Re: PD4ML cannot access Times New Roman Font
   PostPosted: 11 Sep 2017, 13:51 
PD4ML Support Any help on this problem?

We restarted the JBOSS in all 3 PROD servers on Thursday and this problem has surfaced in only the 3rd server today.


  Subject: Re: PD4ML cannot access Times New Roman Font
   PostPosted: 11 Sep 2017, 14:03 
I suspect the issue is caused by font caching. Could you perform two experiments: disable caching (1) and clear cache after each conversion (2) as described in the thread:

pdf-generation-troubleshooting-f4/pd4ml-cache-enable-false-t539.html

Does #1 or #2 help?


  Subject: Re: PD4ML cannot access Times New Roman Font
   PostPosted: 13 Sep 2017, 22:01 
I am afraid, both these options cannot be done since it is a PRD environment and we do not have access.

Can you please let us know how does pd4ML embed the fonts into the PDF. Does it store the fonts files into temp folders some where on the linux server or does it load it into RAM memory and then tries to fetch it from there?
The reason I ask is because, the issue PDF shows the Times Roman and Times Bold but does not say it as EMBEDDED when i look at the Document Properties option in Acrobat Reader DC. But the non-issue reports has these fonts as embedded.

Can too much of traffic or any memory leaks cause these issues with PD4ML?


  Subject: Re: PD4ML cannot access Times New Roman Font
   PostPosted: 14 Sep 2017, 11:53 
HI Team,

Any inputs?


  Subject: Re: PD4ML cannot access Times New Roman Font
   PostPosted: 18 Sep 2017, 13:18 
> Does it store the fonts files into temp folders some where on the linux server or does it load it into RAM memory and then tries to fetch it from there?

PD4ML loads the resources via the class loader:

URL url = Thread.currentThread().getContextClassLoader().getResource(resourcePath);

if (url == null) {
	url = ClassResourceProvider.class.getClassLoader().getResource(resourcePath);
}

if (url == null) {
	ClassLoader cl = callingClass.getClassLoader();
	if (cl != null) {
		url = cl.getResource(resourcePath);
	}
}


In some environments the above code does not work as expected. For example when the resource JAR is placed to WAR, EAR etc the classloader may fail with a TTF load. Usually appserver configuration adjustment (something like "unpack JARs to work directory") helps.



[Reply]     [ 9 posts ] 

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