Discussion
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!
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?
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.
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"/>
Capgemini
CA
Hi @KIRAN_KUMAR,
Can you please tell me what is
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
Accenture
IN
Hi,
Kiran_kumar,
Can you please tell me what is
Hi,
Kiran_kumar,
Can you please tell me what is
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)...