I generating the attachment from trigger action, Need to generate the attachment as pdf file, contains image from static resource and value from text area field. I have trying to use blob.toPdf() to convert the pdf,
I am able to generate the pdf file from text area, however not able to add image into pdf file.
Please find below code,
Blob body=[Select Name, ContentType, Body From StaticResource where name='resoursename'].body; Attachment attachmentPDF = new Attachment(); attachmentPdf.parentId = cse.id; attachmentPdf.name = cse.name + '.pdf'; attachmentPdf.body = blob.toPDF('text area values'); insert attachmentPDF;
Could you please let me know how to combine image and text area in single pdf file.