Save Gmail Messages as PDF – Google Apps Script

The following Google Apps Script will convert a Gmail Message into a PDF file using the built-in PDF converter of Google Docs (now Google Drive).

The script reads the body of the Gmail message, save it as an HTML file and then converts the HTML into a PDF. It then forwards the PDF and message attachments (if any) to your email address using the MailApp.sendEmail service of Apps Script. Credit: Stack Overflow