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
Due to a recent change made by Microsoft, the originally stated options included in this document for addressing the described behavior are no longer valid. The valid options as of April 2025 are:
Update to the following Pega Platform versions with the fix:
Pega Platform 24.1.3, see Pega Platform 24.1.3 Patch Resolved Issues.
OR
As a workaround, apply one of the following hotfixes:
- HFIX-C584 on Pega Platform 8.8.5
- HFIX-C871 on Pega Platform 23.1.4
- HFIX-C675 on Pega Platform 24.2.1
HFIX- C584, HFIX- C871, and HFIX- C675 updates Pega’s docx4j library version to docx4j 8.3.14 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.