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

HTMLToPDF generation fails when using OpenJDK 1.8

SA-68762

Summary



HTMLToPDF generation using PD4ML library fails when using OpenJDK 1.8.
HTMLToPDF works when using Oracle JDK 1.8.



Error Messages



com.pega.pegarules.pub.PRRuntimeException: Caught exception while creating PDF from HTML stream 
...
Caused by: java.lang.NullPointerException 
at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264) ~[?:1.8.0_181-ojdkbuild] 
at sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:219) ~[?:1.8.0_181-ojdkbuild] 
at sun.awt.FontConfiguration.init(FontConfiguration.java:107) ~[?:1.8.0_181-ojdkbuild] 
at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:774) ~[?:1.8.0_181-ojdkbuild] 
at sun.font.SunFontManager$2.run(SunFontManager.java:431) ~[?:1.8.0_181-ojdkbuild] 
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_181-ojdkbuild] 
at sun.font.SunFontManager.<init>(SunFontManager.java:376) ~[?:1.8.0_181-ojdkbuild] 
at sun.awt.FcFontManager.<init>(FcFontManager.java:35) ~[?:1.8.0_181-ojdkbuild] 
at sun.awt.X11FontManager.<init>(X11FontManager.java:57) ~[?:1.8.0_181-ojdkbuild] 

...


Steps to Reproduce



Invoke the HTMLToPDF activity which calls the PDFUtils.generatePDF.


Root Cause



The OpenJDK package used did not have JDK. Instead, the package contained JRE.


Resolution



Perform the following local-change:

Modify the Java package to a package with ‘Developer package included’.

 

Published November 30, 2018 - Updated December 2, 2021

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