Here is another tutorial for generating PDFs from emails received from “Email by Zapier” or from any other source providing parsed emails.
How to Convert Gmail Emails to PDF Using Zapier and PDF.co
This tutorial shows how to automatically convert incoming Gmail messages into PDF documents using Zapier and PDF.co.
Prerequisites
You will need:
- A Gmail account
- A Zapier account
- A PDF.co account
Step 1: Create the Gmail Trigger
Create a new Zap and select:
- App: Gmail
- Trigger event: New Email
Connect your Gmail account. Select the mailbox or label that Zapier should monitor, such as Inbox.
Test the trigger and select an email containing HTML content. The test record should include a Body HTML value.
Step 2: Add the PDF.co Action
Add another step and select:
- App: PDF.co
- Action: HTML to PDF
Connect your PDF.co account by signing in and authorizing Zapier.
Step 3: Configure the HTML-to-PDF Conversion
Configure the PDF.co action:
- HTML: Map the Gmail Body HTML value.
- Output File Name: Enter a name such as
gmail-message.pdf. You can also include values from Gmail, such as the message date or subject. - Paper Size: Select
LetterorA4. - Orientation: Select
Portrait. - Margins: Enter the desired page margins, such as
20px. - Print Background: Enable this option if the email contains background colors or images.
Headers, footers, and other advanced settings can be left empty unless they are required for your document.
The HTML to PDF converter supports raw HTML, page sizes, margins, orientation, backgrounds, headers, and footers. Additional options are described in the PDF.co HTML to PDF documentation.
Step 4: Test the Conversion
Test the PDF.co action. When the conversion finishes, PDF.co will return a URL for the generated PDF.
Open the URL and verify that the email content and formatting appear correctly.
Step 5: Save or Send the PDF
PDF.co output URLs are temporary. Add another Zapier action if the PDF needs to remain available. For example, you can:
- Upload it to Google Drive, Dropbox, or OneDrive
- Attach it to an outgoing email
- Save it in a document-management system
Map the PDF.co output URL into the destination app’s file field.
Conclusion
Your Zap will now convert each matching Gmail message from HTML into a PDF automatically. The resulting document can then be stored, emailed, or passed to another application in the workflow.
Related Tutorials
