
Automate Factur-X and ZUGFeRD e-Invoices in Python with PDF.co
15 MIN READ
In this tutorial, we will guide you through the process of generating a PDF using Formsite data with the help of PDF.co and Zapier. We’ll provide a step-by-step guide to automate the workflow, allowing you to seamlessly integrate data from Formsite into a customized PDF document using raw HTML code.
If you already have a PDF template, you can refer to this guide to streamline the process using your existing template.
Let's begin by adding the Formsite module. Then, select the "New Form Result" trigger to retrieve data from the submitted form.
Next, configure the setup by selecting the specific form you want to monitor for new submissions. This will ensure that Zapier retrieves the data from the correct form whenever a new result is submitted
Now, test the trigger to ensure that Zapier successfully retrieves the submitted form data from Formsite.
Next, add the PDF.co app to your automation in Zapier. Choose the "HTML to PDF Converter" feature within PDF.co to generate a PDF document using the data submitted from Formsite.
In the PDF.co action’s HTML or URL Input field, paste this complete document:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Form response</title>
</head>
<body>
<h1>Form response</h1>
<dl>
<dt>Reference</dt>
<dd>DEMO-001</dd>
<dt>Contact name</dt>
<dd>Example Customer</dd>
<dt>Request</dt>
<dd>Please prepare a service summary.</dd>
</dl>
</body>
</html>These values are examples. Replace them using Zapier’s field picker:
Available fields depend on your Formsite form. Click where each example value appears and insert the corresponding trigger field. Typing a field’s name as ordinary text does not create a dynamic mapping.
Keep the HTML tags in place. Encode special characters in submitted text before inserting it as HTML content. For example, Example & Company should become Example & Company. Encode the incoming values, not the complete HTML document.
In Name, type form-response-, insert the form-result identifier, and finish with .pdf. This helps match each PDF to its source submission.
Test with one submission and compare every mapped value in the generated PDF with that response before continuing to Google Drive.
When configuring Google Drive → Upload File, map the PDF.co output url into the File field. This allows Google Drive to retrieve the actual PDF, rather than store the URL as ordinary text. Complete the upload before the temporary link expires, then open the saved file to confirm it is the expected PDF.
Now, proceed to test the action to ensure that a PDF document is generated successfully from the data submitted via Formsite.
Copy the provided URL and paste it into your browser to view the generated PDF.
Now, upload the generated PDF file to your desired Google Drive folder. This will store the document securely and make it easily accessible whenever needed.
Test the file upload by sending a request to Google Drive. This will ensure that the generated PDF is successfully saved in the specified folder.
After the upload is complete, open the Google Drive folder to confirm that the file has been successfully uploaded and is correctly stored in the specified location.
In this tutorial, we’ve walked you through the process of generating a PDF using Formsite data, seamlessly integrating it into a customized document with the help of PDF.co and Zapier. By following the step-by-step guide, you can now automate your workflow, transforming raw HTML code and Formsite inputs into polished PDFs effortlessly.
But this is just the beginning! The powerful integration of PDF.co and Zapier opens up a world of possibilities. You can also:
And so much more. The flexibility and ease of use offered by these two platforms make it simple to streamline your document generation processes across various tools and services.
Create an account, get an API key and test a request.