I want to use Blob.toPDF() method to create attachment body, currently using:
attachmentPDF.Name = account.Name + '.pdf'; attachmentPDF.body = Blob.toPDF(pdfContent);`
Inside pdfContent I want to incorporate image and some text in this way pdfContent=EncodingUtil.base64Decode(call.Signature__c) and some text fileds too pdfContent=pdfContent+ call.Account__c . Please suggest some technical solutions using the Blob.toPDF() method
16.2k 8 8 gold badges 49 49 silver badges 86 86 bronze badges
asked Aug 11, 2014 at 8:52
Testing_SFDC Testing_SFDC
2,950 10 10 gold badges 64 64 silver badges 144 144 bronze badges
Blob.toPDF() should work with a simple HTML input string. So you might do something like the following (untested):
answered Aug 11, 2014 at 11:15
Alexander Johannes Alexander Johannes
1,581 1 1 gold badge 11 11 silver badges 18 18 bronze badges
Hi Alexander, i've tried this out, throwing me some error 'Review all error messages below to correct your data. An error occurred while parsing the input string.' please suggest. I've used pdfContent= pdfContent + FORM_HTML_START ; pdfContent =''; pdfContent= pdfContent+FORM_HTML_END ;
Commented Aug 12, 2014 at 12:19