Convert HTML to PDF with Apps Script

With Google Script, you can convert any HTML content into a PDF file with a few lines of code. The PDF file can be saved to Google Drive or you can email the file as an attachment using the GmailApp service.