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

pzGenerateDocument fails to embed dynamic images

SA-79035

Summary



A Word Merge document template is configured to embed dynamic images through the following nested field codes.

{pega:binary binaryfile ={ pega:reference .WhichImage }}

After converting this document, to be generated server-side, using pzGenerateDocument, the images are not embedded.


Error Messages



Field Codes: pega:attachment/ pega:binaryfile/ pega:binary are not supported in the current documentation. Please use pzInsertDocumentObject to achieve the same functionality.


Steps to Reproduce

  1. Convert the Word Merge template document from .doc to .docx.
  2. Use the following API

    @(Pega-AppDefinition:DocumentApp ).pzGenerateDocument("Your_Template", tools,"Your_Class",null)
     
  3. Use the below Field code to embed the binary images.

    {pega:binary binaryfile ={ pega:reference .WhichImage }}


Root Cause



The Field codes used by Word Merge are not supported by the pzGenerateDocument DCO API.


Resolution



Perform the following local-change:
  1. Create an HTML rule and embed this in a Corr rule which is referenced in the Word template.
  2. In the HTML rule, define the following tags,

    <PegaDocumentObject><pega:reference name=".WhichImageInsKey"/></PegaDocumentObject>

    The property in this scenario contains the full pzInsKey of the image binary which is embedded. 

    This is resolved as below:


    <PegaDocumentObject>RULE-FILE-BINARY WEBWB IMAGE1!PNG #20190327T184956.304 GMT</PegaDocumentObject>

Published May 17, 2019 - 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