Question
BOA
IN
Last activity: 1 Feb 2026 12:07 EST
How to insert a image in Paragraph rule to display it in a PDF?
To Insert a image from Binary file into a paragraph rule and display it as PDF i followed below steps and it worked
Activity
Non auto generated section
Paragraph
Binary file with image
Paragraph rule has code as below with binary file pzinskey as below.
<% String ImgData=tools.getDatabase().open("RULE-FILE-BINARY WEBWB LHH_xxxxxxxxxxxx!PNG #20260129T103048.129 GMT",false).getString("pyFileSource"); %>
<img src="data:image/png;base64,<%=ImgData.trim()%>" style="object-fit:cover;display:block;" height="750" width="650" >
Non Auto gen section:
To Insert a image from Binary file into a paragraph rule and display it as PDF i followed below steps and it worked
Activity
Non auto generated section
Paragraph
Binary file with image
Paragraph rule has code as below with binary file pzinskey as below.
<% String ImgData=tools.getDatabase().open("RULE-FILE-BINARY WEBWB LHH_xxxxxxxxxxxx!PNG #20260129T103048.129 GMT",false).getString("pyFileSource"); %>
<img src="data:image/png;base64,<%=ImgData.trim()%>" style="object-fit:cover;display:block;" height="750" width="650" >
Non Auto gen section:
<pd4ml:transform
pageFormat="A4"
pageOrientation="potrait"
>
<div>
<pd4ml:page.header>
<pega:include name="DocHeaderrule" type="Rule-HTML-Paragraph"/>
</pd4ml:page.header>
<pd4ml:page.footer>
<pega:include name="DocFooter" type="Rule-HTML-Paragraph"/>
</pd4ml:page.footer>
<pega:include name="IMPEReleasePDFStyle" type="Rule-HTML-Section"/>
<pega:include name="paragraphrulenamexxxx" type= "RULE-HTML-Paragraph"/>
</div>
Activity:
method:Property-Set-Stream
Params:
Local.theHTML to hold output
Rule-HTML-Section
Autogensectionname
Call HTMLToPDF OOTB activity
</pd4ml:transform>
@Pavani_Regulagedda You can try by storing the image as a Rule-File-Binary record and read its pyFileSource value (Base64) in the Paragraph using a DB open call. In the same Paragraph rule, render the image with an HTML <img> tag using a data URL like data:image/png;base64, plus the Base64 string. Then include that Paragraph rule inside your non-autogenerated Section that is wrapped with <pd4ml:transform> so PD4ML converts it into PDF content. In your Activity, generate the full HTML using Property-Set-Stream into a string property (like Local.theHTML) and make sure it includes the Section that contains the Paragraph. Finally, call the ootb HTMLToPDF activity with that HTML string, and the image will appear in the generated PDF.