You need to sign in to do that
Don't have an account?
SkiesnPies
Attachment Images Rendered In HTML But Not In PDF
Hi, I have had lots of problems getting a PDF rendered with images that live in attachments. The attachments render beautifully when my VF page is presented in HTML, but as soon as I say renderas="PDF" the images become broken.
Neither of these tags work :
<apex:image url="https://c.na11.visual.force.com/servlet/servlet.FileDownload?file={!AttachmentID}"/>
<img src="https://c.na11.visual.force.com/servlet/servlet.FileDownload?file={!AttachmentID}"/>
(note: I deliberately set the URL to the full path during testing / experimentation).
I have read that you need to set your remote site settings to contain your server, so the PDF generation can look back to Salesforce to see the records, see below for my settings.
Should this work? Are my remote site settings wrong or did I fundamentally miss something? Thanks in advance.
Neither of these tags work :
<apex:image url="https://c.na11.visual.force.com/servlet/servlet.FileDownload?file={!AttachmentID}"/>
<img src="https://c.na11.visual.force.com/servlet/servlet.FileDownload?file={!AttachmentID}"/>
(note: I deliberately set the URL to the full path during testing / experimentation).
I have read that you need to set your remote site settings to contain your server, so the PDF generation can look back to Salesforce to see the records, see below for my settings.
Should this work? Are my remote site settings wrong or did I fundamentally miss something? Thanks in advance.
This way I could get around the problem (bug??) of not being able to see attachments but still retain the image as an attachment. Poor that I had to work around in this way, but its a workaround that seems effective.
All Answers
Use Static Resource to Put the image, instead of Document, It will work for PDF
--
Swayam
@salesforceguy
This way I could get around the problem (bug??) of not being able to see attachments but still retain the image as an attachment. Poor that I had to work around in this way, but its a workaround that seems effective.