How to insert Data-Content-Image instance in Word Document

Hi All,

I have a requirement to generate a QR Code and attach it to the Word document( I’m creating the Word documents by passing the word template as a param to the pxGenerateAndAttachDocument).

I have created QR as an Image in the Data-Content-Image class and added it in the UI to verify whether it’s correct. I’m able to scan and view the information in it.

The problem is inserting the QR code as an image in the Word document, I have tried these tags to display but none of them are useful.

  1. <pegaref config={“name”:“QRCorrespondence”,“type”:“C”}> (I have inserted HTML(Code to retrieve the image) section in the correspondence.

  2. {pega:insert Corr=QRCorrespondence!}

See the attachments.

Please suggest how to insert the Data-Content-Image instance in the Word document.

Using 8.7.6 v

I really appreciate any help you can provide.

Lakshman

@LakshmanKumarThota

To insert a Data-Content-Image instance, such as a QR code, into a Word document in Pega 8.7.6, you can follow these steps:

  1. Create a Correspondence Rule: Create a correspondence rule and include the section that contains the QR code image.\

  2. Use the PegaDocumentObject Tag: Use the <PegaDocumentObject> tag to insert the image. The tag should include the InsKey of the image rule. For example:

Your image Key(InsKey of the rule)

  1. Modify the Word Template: Insert the created correspondence rule into the Word template. If you are editing an existing Word template, modify it by adding the created correspondence rule

Generate the Document: Write an activity and call the RUF pzGenerateDocument, which will give you the URL of the generated document. You can refer to the pzDocumentNow activity for additional help

This approach should help you successfully insert the QR code image into your Word document

:warning: This is a GenAI-powered tool. All generated answers require validation against the provided references.

Generate word document using word document, which can show data from page list, table format dynamically

Also check out this post.

Hi @MarijeSchillern,

I have followed above approach to insert the image dynamically with PegaDocumentObject tag in the section and inserted the section in a correspondence and then finally inserted the correspondence in the word template.

After following this approach, the document is not generating and getting the error as class does not exist. please find the tracer image below.

I have imported the jar file in the local edition which is available in the solution that you provided, and followed the steps to generate the word documents, there is no image is inserted in the generated document.

That too the solution provided 8 years ago

Can you please provide any solution which is provided recently?

please find the generated word document and tracer image.

Thanks,

Lakshman

@LakshmanKumarThota if you believe the product is not working as documented, please log a support incident ('Error ‘class does not exist’ when trying to insert the image dynamically with PegaDocumentObject tag ) and provide the INC id here so that we can track this.

Hi @MarijeSchillern

I have raised a Pega support ticket. please have a look at the INC below

INC-B33227

Thanks,

Lakshman

The Pega Support team has provided a new JSP tag to show the image in a Word document and it’s working.

<pegaref config={“name”:” .PropA”,”type”:”A” ,“width”:“100”}>

you have to pass the PZINSKEY of your image instance to this property PropA ( Text input).

Thanks,

Lakshman

3 Likes

@LakshmanKumarThota ,

<pegaref config={“name”:” .PropA”,”type”:”A” ,“width”:“100”}>

you used this in <img src= <pegaref config={“name”:” .PropA”,”type”:”A” ,“width”:“100”}> > or you used it in word template ?