Discussion
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Firemans Fund Insurance
US
Last activity: 18 May 2017 5:20 EDT
How to attach Images to PDF in 6.3
When an email comes in to our Pega system, we create a PDF file of the email and attach it to a new or existing Work Object. This works fine for the body and headers of the email, but I would also like any image attachments in the email to be added to the PDF. I can iterate through the attachments and find the images by Mimetype, so I feel like I'm half way there.
Any tips for getting the images into the PDF?
The current PDF is created by Activity HTMLToPDF through an HTML stream.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-01/1fe1bcf2-f206-4551-b56d-5f3439318bc9.jpg?h=f363fb0e&itok=CY3Cjfir)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-01/1fe1bcf2-f206-4551-b56d-5f3439318bc9.jpg?h=f363fb0e&itok=CY3Cjfir)
Labb Consulting
PH
Hi Jeff. I'm going to poll some internal Pega people for you with more specialist knowledge than I, to see if I can get an answer for you. Do you still need help?
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Wipro Ltd
AU
Hi Jeff, I had similar requirement in my project and achieved it as shown below
I had a list of images in a data page and I need to send all these images to PDF.
For all the image streams, I had to add the following syntax before the image stream (depending on your MIME type) and then send for PDF Generation using HTMLToPDF activity.
data:image/png;base64
Hope this helps.
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Wipro Ltd
AU
Use the below code in Rule-Obj-HTML rule instance to preview the image
<img src="data:image/gif;base64,R0lGODlhDwAPAKECAAAAzMzM/////
wAAACwAAAAADwAPAAACIISPeQHsrZ5ModrLlN48CXF8m2iQ3YmmKqVlRtW4ML
wWACH+H09wdGltaXplZCBieSBVbGVhZCBTbWFydFNhdmVyIQAAOw=="
alt="Base64 encoded image" width="150" height="150"/>
If the image stream is dynamically populated, we can use the below code in a control
<img src="data:image/gif;base64,<pega: reference name="Param.Source" /> ">
or
<img src="data:image/gif;base64,<%=tools.getParamValue("Source")%>"alt="Base64 encoded image" width="150" height="150"/>
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Capgemini
CA
Hi @KIRAN_KUMAR,
Can you please tell me what is
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Accenture
IN
Hi kiran,
i am also having same issue unable to see images in genarated pdf. please help me in this
waiting for your reply.
thanks
Pramod k
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Accenture
IN
Hi,
Kiran_kumar,
Can you please tell me what is
Hi,
Kiran_kumar,
Can you please tell me what is
![](https://accounts.pega.com/sites/default/files/pega-user-image/35/REG-34624.png?source=PUMINIT)
![](https://accounts.pega.com/sites/default/files/pega-user-image/35/REG-34624.png?source=PUMINIT)
Pegasystems Inc.
GB
I tried this on 61SP2 - and it works (see attached PDF also):
I added your base64 code (actually I just copied your entire img tag) into a Rule-HTML-RULE like this:
I tried this on 61SP2 - and it works (see attached PDF also):
I added your base64 code (actually I just copied your entire img tag) into a Rule-HTML-RULE like this:
This *should* work on 63SP1 as well (but I haven't tried it)...