Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Caught exception while creating PDF from HTML stream



User configured the Create PDF smart shape in a flow but the PDF does not generate successfully.
The user has the application server on RHEL 7.4 operating system.

Error Messages

The below error appears in the log :-

@baseclass HTMLtoPDF activity, step 4 - " Caught exception while creating PDF from HTML stream".

Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at sun.font.CompositeStrike.getStrikeForSlot(
at sun.font.CompositeStrike.getFontMetrics(
at sun.font.FontDesignMetrics.initMatrixAndMetrics(
at sun.font.FontDesignMetrics.<init>(
at sun.font.FontDesignMetrics.getMetrics(
at sun.font.FontDesignMetrics.getMetrics(
at sun.awt.SunToolkit.getFontMetrics(
at sun.awt.HeadlessToolkit.getFontMetrics(
at org.zefer.font.c.super(Unknown Source)
at org.zefer.font.c.<init>(Unknown Source)
at org.zefer.cache.ResourceCache.getFontMetrics(Unknown Source)
at org.zefer.html.doc.q.Ó00000(Unknown Source)
at org.zefer.html.doc.q.Ö00000(Unknown Source)
at org.zefer.html.doc.w.<init>(Unknown Source)
at org.zefer.html.doc.PD4MLHtmlParser.buildDocument(Unknown Source)
at org.zefer.pd4ml.PD4ML.o00000(Unknown Source)
at org.zefer.pd4ml.PD4ML.render(Unknown Source)
at com.pega.pegarules.integration.engine.internal.util.PDFUtilsImpl.invokePD4ML(
at com.pega.pegarules.integration.engine.internal.util.PDFUtilsImpl.convertHTMLToPDF(
at com.pega.pegarules.integration.engine.internal.util.PDFUtilsImpl.generatePDF(

Steps to Reproduce

1. Create a Flow.
2. Configure a Create PDF smart shape.

Root Cause

This is an issue with the RHEL OS version 7.4.

In this OS version the the default font has changed from Utopia to STIX.
The Open JDK does not go well with the STIX font and thus the PD4ML library fails during PDF generation.


Make the following change to the operating environment:

1. Create a file /etc/fonts/local.conf and include the below entries
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>

2. Save the file and restart the server and check the PDF generation from Pega.

Published February 21, 2018 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us