How to Create PDF from Scratch using PDF.co and Zapier

4 Minutes Read

This tutorial covers two ways to create a PDF from scratch using PDF.co and Zapier:

  • PDF Filler: Build a PDF by placing text and images at specific coordinates.
  • HTML to PDF: Convert HTML code, an HTML template, or a webpage into a PDF.

Option 1: Create a PDF with PDF Filler

Create a Zap and Select a Trigger

Sign in to Zapier and create a new Zap. Select the app and event that should start the workflow.

Test the trigger so Zapier has sample data that can be mapped into the PDF.co action.

Add PDF.co

Add an action, select PDF.co, and connect your PDF.co account using the API key from your PDF.co dashboard.

Choose PDF Filler as the action event.

Configure PDF Filler

Leave Source PDF empty to create a new PDF from scratch. Enter at least one text annotation, image, or form field.

Use the following format for text annotations:

x;y;pages;text;fontSize;fontName;fontColor;link;transparent;width;height;alignment

Example:

20;20;0;Hello from PDF.co;24;Arial;000000

Use the following format for images:

x;y;pages;imageURL;link;width;height

Example:

20;80;0;https://example.com/logo.png;;200;100

PDF.co uses zero-based page numbering, so 0 represents the first page. Use 0- to place an object on every page.

Separate multiple objects with the pipe character (|). You can use PDF Inspector to determine the X and Y coordinates.

Enter an Output PDF Name, preferably ending in .pdf.

Test the PDF Filler Action

Test the action and confirm that PDF.co returns a successful status and a URL for the generated PDF.

Open the URL and verify the text, images, page placement, and formatting. The returned URL is temporary, so add another Zapier action to save the PDF if it must remain available.

Option 2: Create a PDF from HTML

Create a Zap and Select a Trigger

Create a new Zap and select the app and event that should initiate PDF generation.

Test the trigger to obtain sample data for the PDF.

Add the HTML-to-PDF Action

Add PDF.co as an action and connect your PDF.co account.

Select the HTML to PDF action, which may appear as HTML to PDF Converter in Zapier.

Configure the Conversion

Choose one of the following content sources:

  • Enter raw HTML in HTML or URL Input.
  • Enter the URL of a publicly accessible webpage.
  • Select an HTML Template ID from your PDF.co templates.

Configure any optional settings:

  • Page Orientation: Select portrait or landscape.
  • Page Size: Select a standard page size.
  • Custom Page Size: Enter dimensions with units, such as 6in 8in.
  • Custom Margins: Enter values in top, right, bottom, left order, such as 10px 15px 10px 15px.
  • Render Page Background: Enable this if the PDF should include HTML background colors and images.
  • HTML Template Data: If the selected template contains variables, supply their values in JSON or CSV format.
  • Name: Enter the output filename.

Example HTML:

<!DOCTYPE html>
<html>
  <body>
    <h1>New PDF Document</h1>
    <p>This PDF was generated with PDF.co and Zapier.</p>
  </body>
</html>

Test the HTML-to-PDF Action

Test the action and open the URL returned by PDF.co. Confirm that the content, page size, orientation, margins, and filename are correct.

The output URL is temporary. Add a storage or delivery action—such as Google Drive, Dropbox, Airtable, or email—if the PDF must be retained.

In this tutorial, you’ve learned how to create a PDF from scratch using PDF.co and Zapier, with either coordinate-based PDF Filler objects or HTML content.

Related Tutorials

See Related Tutorials