Question
Accenture
IN
Last activity: 5 Oct 2016 9:05 EDT
How to attach and display the images in pdf file
Hi All,
We have a requirement like need to display images which are added by the end user in pdf file .this pdf file will be availavle as dowloaded kind of thing.
we are able genarate pdf and all the data is comming properly the issue is user added images to the work object not populated in the final genarating pdf document.
please provide your suggestions or ideas
Thanks
Pramod K
***Updated by Moderator: Vidyaranjan. Removed user added FAQ and Ask the Expert tags. Apologies for confusion, shouldn't have been an end-user option***
-
Likes (3)
Sushma Somireddy Sweta Bhat sangeetha d -
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
IN
Hi,
Could you try the below steps.
1.Create a section.
2.Add the image in that section using pxImage.
3.And pass the section in Create pdf smart shape.
Pegasystems Inc.
IN
Hi Pramod,
I just need a small clarity on the request .
Scenario 1:
You are not able to see the images in pdf after conversion.
Scenario 2:
You are trying to see the images added as attachment in form of pdf.
For the first scenario. Pega uses HTML-To-PDF activity internally to convert html content to pdf.
Images for HTML-To-PDF are loaded by Pega's "PDF Resource Handler."
The PDF Resource Handler does not have any idea where "here" is, because it is called when processing arbitrary HTML.
Your source tag here says "go to the directory one level higher than here" which is why the image will never be loaded.
Images must be included via "static content" URLs or full external URLs with host names like "http://www.emailmyname.com/"
We support "static content" stored in Pega and absolute URLs.
If the picture is at an HTTPS url or FTPS URL, we cannot guarantee that the download will be successful.
If the picture is password-protected in any way, we cannot put it into the PDF because there is no mechanism by which to tell the PDF Resource Handler what the password for each picture is.
please go through the below article this might be of help
https://community.pega.com/support/support-articles/unable-view-logo-image-converted-pdf-0
Accenture
IN
Hi,
we are not able to see the images in the final genarated pdf. we are able to see the required data of the work object.
steps we followed
1) created activity this will populate the data to be included in pdf
2) create a html rule(which is having all clipboard data and images data) we are just refering using <pega> tags
3) calling ootb HTMLTOPDF from one activity
finally we are able to genarate pdf but unable to see the images in the pdf
Please share your ideas/Suggestions.
Thanks
Pramod Kotha
Pegasystems Inc.
GB
What version of PRPC are you using: there are some possible HFIXes needed for Images and Styles for PRPC6.x for instance.
Can you also provide some screenshots/attachments:
1. A screenshot of a 'preview' of the Section that you are trying to convert.
2. The Activity you are using to convert the Section.
3. The resultant PDF (as an attachment please).
Thanks
John
Accenture
IN
Hi John,
We are using prpc 7.2 version
PFA file for your reference.
please give your suggestions/ideas.
Thanks
Pramod
Pegasystems Inc.
GB
Hi Pramod,
I don't really understand the screenshot you provided in the WORD file - the preview of the section doesn't show an image (or does it - does the image look like 'text' on a blue background?)
Also your Activity is apparently doing a 'Propery-Set-HTML' (which is fine - but is it necessary ?) - can you re-code your Activity so that it takes the HTML Rule itself (rather than 'markup') as an argument ?
If you can do that: then you can more easily 'swap-out' the HTMLTOPDF step with a 'ShowStream' Step - which will render the HTML Rule in the browser - which should be more comparable.
Accenture
IN
Hi John,
its not showing any image just comming as blank in preview of section.even we attach the images to case.
comming to second point user wants pdf file not html rule displayed in browser.
so we are using ootb HTMLTOPDF to convert html stream to pdf. and attaching to case.
3) finally we are able to download pdf but its not containing images .
Please help.
Thanks
Pramod
Pegasystems Inc.
GB
If the image is not showing up in the original HTML, shouldn't we be looking into that issue (why would HTMLTOPDF work if the image isn't in the preview ?)