• Zhino Yousefi
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
I want to add an image to a pdf I am creating and attach it to an email that I send via apex code. I am using html and Blob.toPdf() to make the pdf. I saw this post regarding Blob.toPdf()'s limitations on images: https://help.salesforce.com/apex/HTViewSolution?id=000123577&language=en_US. It says:

"To work around this Blob.toPdf()'s limitation you may resort to one of the below approaches:
1. Store the image as a static resource and then use it in code. 
2. Use a Visual Force Page and render it as pdf "

So I tried both ways, the first one throws an error: "An error occurred while parsing the input string" (which happens with <img> tag no matter what src I use). 
And the second way is not an option for me cause I have to get the page content that I'm rendering as pdf and attach it to my email BUT "Page.getContent() does not work in Triggers or Email Services".

Is there a work around this limitations?
 
I'm sending the same email from an apex class and it gets sent all the times, but sometimes I don't receive the email in my inbox.  I also checked the spams for my email account and the emails are not there. Does anyone have the same problem or know about it?
I want to add an image to a pdf I am creating and attach it to an email that I send via apex code. I am using html and Blob.toPdf() to make the pdf. I saw this post regarding Blob.toPdf()'s limitations on images: https://help.salesforce.com/apex/HTViewSolution?id=000123577&language=en_US. It says:

"To work around this Blob.toPdf()'s limitation you may resort to one of the below approaches:
1. Store the image as a static resource and then use it in code. 
2. Use a Visual Force Page and render it as pdf "

So I tried both ways, the first one throws an error: "An error occurred while parsing the input string" (which happens with <img> tag no matter what src I use). 
And the second way is not an option for me cause I have to get the page content that I'm rendering as pdf and attach it to my email BUT "Page.getContent() does not work in Triggers or Email Services".

Is there a work around this limitations?
 
I'm sending the same email from an apex class and it gets sent all the times, but sometimes I don't receive the email in my inbox.  I also checked the spams for my email account and the emails are not there. Does anyone have the same problem or know about it?