Support Article
Unable to use Garamond font family in PDF using pd4ml
SA-70110
Summary
When using a custom activity to invoke pd4ml and generate PDFs, Garamond font is replaced with the Calibri font.
The activity has a Java step using the following code.
pd4ml.useTTF("<SERVER_PATH>", true );
pd4ml.setDefaultTTFs("Garamond", "Garamond", "Garamond");
The HTML stream contains the following reference.
<pd4ml:usettf from="<SERVER_PATH>" serif="Garamond" sansserif="Garamond" monospace="Garamond">
Error Messages
Not Applicable
Steps to Reproduce
- Upload Garamond TTF files to the server path.
- Create an activity to call pd4ml to generate PDFs.
- Write a custom Java step to access the font file, using the code above.
pd4ml.useTTF("<SERVER_PATH>", true );
pd4ml.setDefaultTTFs("Garamond", "Garamond", "Garamond");
- Include the above HTML code in the HTML stream.
<pd4ml:usettf from="<SERVER_PATH>" serif="Garamond" sansserif="Garamond" monospace="Garamond">
Root Cause
An issue in the custom application code or rules.
The custom activity invoked the pd4ml APIs incorrectly.
Resolution
Perform the following local-change: Mention the pyPDFPropsDirectory parameter along with pyPDFFontsDirectory when calling the HTMLToPDF activity instead of implementing a custom call.
Published January 19, 2019 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.