Issue
Error occurs on downloading and opening documents generated from Microsoft Word templates using Pega's DocxGenerator API.
Symptoms and Impact
The following error occurs when you create a Microsoft Word template using Pega’s DocxGenerator API and download and open the document generated from that template:
Steps to reproduce
Follow the below steps to reproduce this error:
- Create a Microsoft Word template.
- Use the OOTB Generate Document shape in the template or call the pxGenerateAndAttachDocument activity within the case flow.
- Process the case to the point where the document is generated and attached.
- Download and open the document.
Root Cause
There is a problem with the docx4j library version used in the Pega Platform. The error occurs due to Pega's docx4j library not declaring the “w16du” namespace, which is required by Microsoft Word.
Solution
As a workaround:
- Apply HFIX-B2415 to remediate this error in Pega Platform™ 23.1.1.
- Apply HFIX-B2329 to remediate this error in Pega Platform 8.8.5. Versions 8.8.3 and 8.8.4 must update to Pega Platform 8.8.5 and apply HFIX-B2329 to remediate the issue.
- Apply HFIX-B2515 to remediate this error in Pega Platform 8.7.6.
HFIX-B2415, HFIX-B2329, and HFIX-B2515 updates Pega’s docx4j library version to docx4j 8.3.10 which resolves the error.
You can request the hotfixes from the My Support Portal by selecting the Existing Hotfix ticket type. For more information on creating a support ticket, refer to My Support Portal FAQs.
As a best practice, update your Pega deployment to the latest release as explained in Keeping current with Pega.