How to Generate a PDF from Cognito Forms Data Using Zapier
This tutorial shows how to generate a formatted PDF whenever someone submits a Cognito Form.
The workflow follows this sequence:
Cognito Forms submission → PDF.co HTML to PDF → Save or send the PDF
What You Will Need
- A Cognito Forms account with a published form
- A Zapier account
- A PDF.co account
- At least one test submission in Cognito Forms
Step 1: Create the Cognito Forms Trigger
Create a new Zap and select Cognito Forms as the trigger application.
Configure the trigger:
- Trigger Event: New Entry
- Form: Select the Cognito Form whose submissions should generate PDFs.
Connect your Cognito Forms account and test the trigger. Confirm that Zapier retrieves the test submission and displays the form fields you want to include in the PDF.
Step 2: Add the PDF.co Action
Add an action and select PDF.co.
Choose HTML to PDF as the action event. Connect your PDF.co account when prompted and authorize Zapier to access it.
The HTML to PDF action accepts raw HTML, a webpage URL, or a saved PDF.co HTML template. This workflow uses raw HTML containing values from the Cognito Forms trigger.
Step 3: Create the PDF Content
In HTML or URL Input, enter the HTML that will define the PDF’s content and appearance.
For example:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
body {
margin: 40px;
color: #222;
font-family: Arial, sans-serif;
font-size: 14px;
}
h1 {
color: #2457a7;
border-bottom: 2px solid #2457a7;
padding-bottom: 10px;
}
.field {
margin-bottom: 16px;
}
.label {
font-weight: bold;
}
</style>
</head>
<body>
<h1>Form Submission</h1>
<div class="field">
<span class="label">Name:</span>
INSERT_NAME_FIELD
</div>
<div class="field">
<span class="label">Email:</span>
INSERT_EMAIL_FIELD
</div>
<div class="field">
<span class="label">Message:</span>
INSERT_MESSAGE_FIELD
</div>
</body>
</html>Replace each INSERT_..._FIELD marker with the corresponding Cognito Forms value using Zapier’s data-mapping controls. Add or remove sections to match the fields in your form.
Step 4: Configure the PDF Settings
Configure the remaining HTML to PDF fields:
- Page Orientation: Select Portrait or Landscape.
- Page Size: Select a standard size such as Letter or A4.
- Custom Margins: Enter margins such as
20px. - Render Page Background: Enable this if the HTML uses background colors or images.
- Media Type: Select Print for a print-oriented layout.
- Name: Enter an output filename. You can map a Cognito Forms value to create a unique name, such as
Submission-Name.pdf.
For all available settings, see the HTML to PDF action documentation.
Step 5: Test the PDF Generation
Test the PDF.co action.
A successful test returns a temporary URL for the generated PDF. Open the URL and confirm that:
- The correct submission data appears.
- The HTML formatting is applied.
- The page size and margins are appropriate.
- The output filename is correct.
Revise the HTML or PDF settings if necessary, then test again.
Step 6: Save or Send the PDF
Add another action to store or distribute the generated PDF. For example, you can:
- Upload it to Google Drive, Dropbox, or OneDrive.
- Attach it to an email.
- Send it to a CRM or document-management system.
Map the output URL from the PDF.co step to the destination application’s file field. Test the complete workflow and publish the Zap.
Conclusion
The Zap will now convert every new Cognito Forms submission into a formatted PDF using the dedicated PDF.co HTML to PDF action. The HTML controls the document’s design, while mapped Cognito Forms values personalize each generated file.
PDF.co and Zapier can also quickly generate PDFs using:
- Formsite data;
- Airtable data;
- DocuSign Envelope data;
- and data from several other digital forms.
Related Tutorials

