Support Article
Generated PDF is not properly displaying custom font
SA-31549
Summary
A custom font has been configured in the parameters for PDF generation; however, the generated PDFs are not including the expected font. On the screen, HTML review shows the proper characters but the PDF does not due to a missing embedded font. User verified the font file is available on the server in the specified directory.
Error Messages
Not Applicable
Steps to Reproduce
- Place font in accessible server directory.
- Create HTML stream with characters needing special font.
- Apply cell inline style to cells in the repeat grid text area control (on Presentation > Advanced Presentation Options).
- Call activity pyViewAsPDF, which in turn uses HTMLToPDF.
Root Cause
An issue in the custom application code or rules.
The section that was rendered depended on two fonts defined in the skin; however, the custom section was using specific style information within some cells of the repeat. This overrides the style so the proper font was not used.
Resolution
Perform the following local-change steps:
- Ensure the parameters to pyViewAsPDF include the parameter pyPDFFontsDirectory with the proper directory for the font file and the parameter pyPDFEmbendFont set to true.
- Also add font-family:SpecialFont1,SpecialFont2 to the existing cell inline style to elements which need it.
Published December 26, 2016 - 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.