0

When I try to a add an image in my PDF attachment of my email :

<messaging:attachment filename="test.pdf" renderAs="PDF">
    <apex:image value="https://drive.google.com/uc?id=1dRlAxFf-pg0XOwQ293ypAXZ1g4HGKzTC"/>
</messaging:attachment>

The image is not displayed.

Why ?

4
  • I assume it is because your image is not publicly available. Try adding the image as a externally available document in Salesforce and referencing that.
    – Ranga
    Commented Jun 15, 2018 at 13:53
  • My image is accessible in public, I usually use these links to put pictures on forum.
    – Apaachee
    Commented Jun 15, 2018 at 13:57
  • help.salesforce.com/…
    – Apaachee
    Commented Jun 15, 2018 at 14:40
  • can you try use https://doc-00-2k-docs.googleusercontent.com/docs/securesc/ha0ro937gcuc7l7deffksulhg5h7mbp1/5uvdfm5iu40t7gj9as9daqi3f6e597n3/1529078400000/03456987841964459010/*/1dRlAxFf-pg0XOwQ293ypAXZ1g4HGKzTCz
    – kurunve
    Commented Jun 15, 2018 at 16:02

1 Answer 1

1

The problem you're having is that PDF rendering doesn’t support images encoded in the 'data: URI' scheme format. See Adding Attachments. You've not set the image link in CORS, so the render engine doesn't view it as being safe/secure content. If you want it to render properly, you preferably want to set it up as a static resource.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .