toPDF() method to generate the PDF content and attach it to the Account record as an Attachment. Notice that ths Blob. toPDF() takes in a String as the input, and that the String content can be formatted with HTML. And here is the PDF that was generated in the Apex Trigger and attached to the Account record