doqs logodoqsPDF Generator API

A guide to fill you PDF form with doqs

In this guide, we will show you how to fill out any PDF form automatically and retrieve Your PDF document in 3 easy steps:

  • Create the template
  • Adjust field configurations and fields appearance
  • Generate the document

Let's jump into it! We will use the W-8BEN from the IRS to walk you threw this guide.

Create the template

After signing up, head to the apps template section, you can simply create a template by dragging any PDF form or file into the prompted area at the top. You can also create the template by clicking on the drop area and selecting the desired file in the file browser.

After uploading the file, any existing form fields are automatically recognized and their types are inferred. After clicking on the newly created template you should see the editable fields rendered on top of the PDF pages in our template editor.

template editor.

Configure the template

The next step is to configure the form. First of all, adjust the types of the created field and their names (default are the original field names) to your liking. The field names are the keys for the data to be provided in the request body when filling out the PDF.

Additionally, you can configure the appearance of the content of the field. Select color, font size, font, text alignment, and image alignment. You can also delete, add and move fields in the template editor. Besides the appearance, you can also configure functional aspects like the format of a date string, required or not-required fields, or cell and offset formatting.

Generate your document

After the fields are configured you can head over to the preview tab and see example request data for your template. Adjust the contents to your need.

Document preview

When pressing the preview button below, your document will be generated in a draft. version, this does not count towards your billed usage and is free to use up to 10 documents daily.
The result should look similar to this image:

Document preview after generation

You can also generate a document with any other tool, e.g. Postman, Zapier, Bubble, or with a script in any language. Below is an example showing how to generate a document with Python. For that you need to get your API key from the app. Using the development key will result in watermarked PDFs, once subscribed you will also have a live API key available.

import requests

# api key from https://app.doqs.dev/organizationx
apikey = "...."
# your template id
template_id = "tpl_...."

resp = requests.post(
  f"https://api.doqs.dev/v1/templates/{template_id}/fill",
  headers={"x-api-key": apikey},
  json={
    "data": {
      "name": "Jon Doe",
      "ssn": "10234234",
      "date_of_birth": "1990-01-01",
      # add rest of the required and not required field values.
    }
  }
)

if resp.ok:
  pdf_file_bytes = resp.content

For more technical information have a look at our documentation.

With doqs you can fill PDF forms efficiently at scale and separate the appearance from the implementation. If you have any questions feel free to reach out in the chat. Let us know if you miss a feature.
Happy document generation!