PD4ML v4 › Forums › PD4ML v3 Archived Forums (Read Only) › PD4ML Tips & Tricks › Case Study: PD4ML used on CCA + Images and fonts issues › Re: Re: Case Study: PD4ML used on CCA + Images and fonts issues
First, images with relative urls didn’t seem to work. The solution was obvious – use absolute urls for which we created a little Ruby helper method that prepended the full path to the image.
In general relative image references work correctly in PD4ML. A problem may happen in specific J2EE scenarios (a web application is deployed as non-expandable JAR or WAR file, for instance), but useServletContext() API call usually helps in such situations.
I would recommend you to switch the debug mode on (pd4ml.enableDebugInfo()) and to inspect the log file of the server. It should dump resolved relative URLs it tries to load.
Second, and much more frustrating! It seems that PD4ML doesn’t quite support all of the CSS I thought it would. Even though I had thought it supported font-family CSS properties, I could never get my basic font choices to appear in the PDF’s. This was really frustrating since our client, the CCA is pretty rigorous about which fonts it uses in publications. So the solution: I broke down and used the super old-school font-tag. Yeah, it really isn’t standard compliant and that kind of drives me nuts, but since the file generated is intended only for print and export to PDF I guess it works. And thats the point, it really does work and so the fonts I required are there.
You may use in the resulting PDFs virtually any TTF font of your choice, but for that you would need to utilize TTF embedding feature of PD4ML: