Question


CollabPartnerz
IN
Last activity: 1 Mar 2024 6:07 EST
Generate the PDF and attach to case by capturing images
how to pass the below format value to create a PDF in pega
btoa(canvas.toDataURL("image/png").replace("data:image/png;base64,", "")
do we have any ootb activities? to generate PDF and attach to the case.
***Edited by Moderator Rupashree S. to add Capability tags***
-
Reply
-
B Anurag Patil -
Share this page Facebook Twitter LinkedIn Email Copying... Copied!


DXC
AU
Hi
You can check pxCreatePdf create a pdf and attach it to the case, or HTMLTOPDF for the following.


CollabPartnerz
IN
@gasharmawhat I was looking for is a way to capture an image using any cam and attach that image in the form of PDF in a case.
While trying so the image is generating but it is not getting attached to the case.
I am wondering whether we have any OOTB activities to help achieve this functionality.


DXC
AU
@B Anurag 1. Create a section that displays all your captured images in the list and then pass that section to the pxcreatepdf activity.
It should create the pdf and it will have it.


CollabPartnerz
IN
@gasharmaI already have the file stream ready. wanted to know if there is any OOTB activity to pass the file stream as a param so that i can attach it to the case.


CollabPartnerz
IN
@duraisankar i have Image base64 Stream.
Updated: 1 Mar 2024 6:07 EST


Capgemini
NO
I am not aware of any OOTB Activity which converts base64 of image to PDF.
Considering you have base64 of png image, I would suggest create a non Autogenerated Section and have below code as the HTML source. You can parameterize below code using JSP tags and section parameters if required.
<img src="data:image/png;base64, STREAM_HERE" alt="Alt text here" />
Example :
<img src="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUA AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO 9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Alt text here" />
You can pass this section name as parameter to pxCreatePDF
Let me know if you have any questions.