How to Generate a PDF from a Jotform Submission and Email It with PDF.co, Gmail, and Zapier

5 Minutes Read

This tutorial explains how to turn each new Jotform submission into a formatted PDF and email the generated document to the person who submitted the form.

The completed Zap follows this sequence:

Jotform New Submission → PDF.co HTML to PDF Converter → Gmail Send Email

What You Will Need

Before creating the Zap, make sure you have:

  • A Jotform account
  • A published Jotform form
  • At least one test submission
  • A PDF.co account
  • A Gmail account
  • A Zapier account

Your Jotform should include an email field if the generated PDF will be sent back to the submitter.

Step 1: Prepare the Jotform

Create or open the Jotform that will supply the PDF’s content.

For this example, the form can contain:

  • Full name
  • Email address
  • Company
  • Address
  • Phone number
  • Request or message
  • Submission date

Publish the form and submit one complete test response. Zapier will use this response when configuring the remaining steps.

Using realistic test values makes it easier to evaluate the generated PDF’s layout.

Step 2: Create a Zap

Sign in to Zapier and create a new Zap.

Give the Zap a descriptive name, such as: Generate and Email Jotform PDF

Step 3: Configure the Jotform Trigger

Select Jotform as the trigger app.

Choose New Submission as the trigger event. This trigger runs whenever a new response is submitted to the selected form.

Connect your Jotform account and authorize Zapier to access the required forms.

In the Form field, select the form prepared for this workflow.

Step 4: Test the Jotform Trigger

Test the trigger and select the sample submission you created earlier.

Review the returned data and confirm that it includes all information required for the PDF, especially:

  • The submitter’s name
  • The submitter’s email address
  • The form-answer fields
  • The submission date or ID

If a required field is missing, submit another complete response and retest the trigger.

Step 5: Add the PDF.co HTML-to-PDF Action

Add an action after the Jotform trigger and select PDF.co.

Choose HTML to PDF Converter as the action event. This PDF.co action accepts HTML, webpages, and saved HTML templates and provides options for page size, orientation, margins, backgrounds, and media type. The current action is listed on the PDF.co integration page on Zapier.

Connect your PDF.co account through the authorization window and approve the requested access.

Step 6: Select the HTML Input Type

In the PDF.co action, set Input Type to the option for raw HTML code.

An HTML input field will appear. The HTML entered here will provide the layout and content of the generated PDF.

Step 7: Create the PDF Layout

Enter an HTML document in the HTML field. Insert Jotform values with Zapier’s field-mapping menu wherever dynamic information should appear.

The following example creates a clean submission summary:

<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <style>
    body {
      margin: 0;
      color: #222;
      font-family: Arial, sans-serif;
      font-size: 12px;
      line-height: 1.5;
    }

    .document {
      max-width: 720px;
      margin: 0 auto;
    }

    .header {
      margin-bottom: 30px;
      padding-bottom: 15px;
      border-bottom: 3px solid #2f6fed;
    }

    h1 {
      margin: 0 0 5px;
      color: #2f6fed;
      font-size: 26px;
    }

    .subtitle {
      color: #666;
    }

    .section {
      margin-bottom: 22px;
    }

    .section-title {
      margin-bottom: 10px;
      color: #444;
      font-size: 15px;
      font-weight: bold;
    }

    .field {
      margin-bottom: 9px;
    }

    .label {
      display: inline-block;
      width: 130px;
      color: #666;
      font-weight: bold;
      vertical-align: top;
    }

    .value {
      display: inline-block;
      width: 540px;
      white-space: pre-line;
    }

    .message {
      padding: 15px;
      border: 1px solid #ddd;
      background: #f6f8fb;
      white-space: pre-line;
    }

    .footer {
      margin-top: 35px;
      padding-top: 10px;
      border-top: 1px solid #ddd;
      color: #777;
      font-size: 10px;
    }
  </style>
</head>
<body>
  <div class="document">
    <div class="header">
      <h1>Form Submission</h1>
      <div class="subtitle">
        Submission ID: INSERT_SUBMISSION_ID
      </div>
    </div>

    <div class="section">
      <div class="section-title">Contact Information</div>

      <div class="field">
        <span class="label">Name</span>
        <span class="value">INSERT_FULL_NAME</span>
      </div>

      <div class="field">
        <span class="label">Email</span>
        <span class="value">INSERT_EMAIL_ADDRESS</span>
      </div>

      <div class="field">
        <span class="label">Company</span>
        <span class="value">INSERT_COMPANY</span>
      </div>

      <div class="field">
        <span class="label">Phone</span>
        <span class="value">INSERT_PHONE_NUMBER</span>
      </div>

      <div class="field">
        <span class="label">Address</span>
        <span class="value">INSERT_ADDRESS</span>
      </div>
    </div>

    <div class="section">
      <div class="section-title">Message</div>
      <div class="message">INSERT_MESSAGE</div>
    </div>

    <div class="footer">
      Submitted on INSERT_SUBMISSION_DATE
    </div>
  </div>
</body>
</html>

Replace each INSERT_... entry by selecting the corresponding dynamic value from the Jotform trigger.

For example:

  • Replace INSERT_FULL_NAME with the Jotform name field.
  • Replace INSERT_EMAIL_ADDRESS with the Jotform email field.
  • Replace INSERT_MESSAGE with the message or request field.
  • Replace INSERT_SUBMISSION_ID with the Jotform submission ID.
  • Replace INSERT_SUBMISSION_DATE with the submission timestamp.

The names displayed in Zapier depend on the fields defined in your Jotform.

Step 8: Configure the PDF Settings

Configure the remaining HTML to PDF Converter options.

A suitable starting configuration is:

  • Page Orientation: Portrait
  • Page Size: Letter or A4
  • Custom Margins: 20px
  • Render Page Background: Enabled
  • Media Type: Print
  • Do Not Wait Until Full Page Load: Disabled
  • File Name: A descriptive name ending in .pdf

For example, combine the submitter’s name or submission ID with a static prefix:

form-submission-INSERT_SUBMISSION_ID.pdf

Use Zapier’s mapping menu to replace INSERT_SUBMISSION_ID with the actual Jotform value.

Enabling Render Page Background ensures that background colors defined in the HTML are included in the PDF.

Step 9: Test the HTML-to-PDF Conversion

Test the PDF.co action.

A successful result should include:

  • A temporary URL for the generated PDF
  • The output filename
  • The number of generated pages
  • A successful processing status

Open the returned URL and inspect the PDF.

Confirm that:

  • Every mapped Jotform value appears correctly.
  • Names and addresses fit within the page.
  • Multiline answers retain readable line breaks.
  • Background colors and borders are present.
  • No content extends beyond the page margins.
  • The filename ends in .pdf.

If a value is missing, return to the HTML field and check its Jotform mapping.

Step 10: Add the Gmail Action

Add another action and select Gmail.

Choose the action for sending an email and connect the Gmail account that will deliver the generated document.

Configure the email:

  • To: Map the submitter’s email address from Jotform.
  • Subject: Enter a clear subject.
  • Body: Add the email message.
  • Attachments: Map the PDF URL returned by PDF.co.

For example, use the subject:

Your Submitted Form PDF

The message could be:

Hello,

Thank you for your submission. A PDF copy of your completed form is attached to this email.

Please keep this document for your records.

You can map the submitter’s first name into the greeting if the Jotform trigger provides it separately.

Step 11: Test the Email

Test the Gmail action.

Open the destination inbox and confirm that:

  • The email arrived.
  • The recipient address is correct.
  • The subject and message are complete.
  • The generated PDF is attached as a file.
  • The attachment opens successfully.
  • The attachment contains the correct Jotform submission.

If the email contains a link rather than a file attachment, confirm that the PDF.co output URL is mapped into Gmail’s Attachments field rather than the message body.

Step 12: Publish the Zap

After every step passes its test, publish the Zap.

Each new submission to the selected Jotform will now:

  1. Trigger the Zap.
  2. Supply the form values to PDF.co.
  3. Generate a formatted PDF from the HTML.
  4. Email the PDF to the submitter.

Handling Optional Form Fields

If some Jotform fields are optional, the PDF may contain empty labels or spaces when those fields are not completed.

You can either:

  • Make important fields required in Jotform.
  • Remove optional fields from the PDF layout.
  • Use separate Paths or Formatter steps to build different content.
  • Use a saved Handlebars template with conditional sections for more advanced documents.

For example, a saved PDF.co HTML template can conditionally include a section only when a value exists:

{{#if company}}
<div class="field">
  <span class="label">Company</span>
  <span class="value">{{company}}</span>
</div>
{{/if}}

Handling User-Submitted Text Safely

Form answers may contain characters such as <, >, &, quotation marks, or line breaks. Test the workflow with representative responses to ensure that user-entered text does not interfere with the HTML structure.

For workflows accepting unrestricted public input, consider escaping HTML-sensitive characters before inserting the values into raw HTML. This can be done in an intermediate formatting or code step.

Saving a Permanent Copy

PDF.co output URLs are temporary. The Gmail step retrieves the document while the URL is available, but you may also want a permanent archive.

Add a storage action after PDF.co or Gmail to save the generated PDF in:

  • Google Drive
  • Dropbox
  • OneDrive
  • SharePoint
  • Another document-management system

Map the PDF.co output URL as the file to upload.

Conclusion

In this tutorial, we learned how to generate PDFs from JotForm submission data using PDF.co. We also learned how to send the generated PDF as an email attachment using Gmail.

This is just one of the many instances wherein you can easily generate PDFs from various digital forms using PDF.co and Zapier. Other examples include:

Related Tutorials

See Related Tutorials