PDF Forms

Fill PDF form fields

Fill form fields in a PDF with the provided values. Optionally flatten the form (convert to static content) and/or protect with a password. Use the inspect endpoint first to discover available field names.

post/api/pdf-forms/fill

Request

  • Base URL: https://api.dokmatiq.com
  • URL: https://api.dokmatiq.com/api/pdf-forms/fill
  • Auth: API key in header X-API-Key

Headers

X-DocGen-Validatestring

Request body

pdfBase64string required

Base64-encoded PDF form file

fieldsobject required

Field values to fill (key = field name, value = field value). For text fields: the text string. For checkboxes: 'Yes'/'On'/'true' to check, 'Off'/'false' to uncheck. For radio buttons: the value of the option to select. For dropdowns/listboxes: the value to select.

flattenboolean

Flatten the form after filling. When true, form fields are converted to static text and the PDF is no longer editable. Recommended for final documents.

passwordstring

Password to protect the filled PDF (optional)

Example request

{
  "pdfBase64": "JVBERi0xLjcK...",
  "fields": {
    "vorname": "Max",
    "nachname": "Mustermann",
    "agb_akzeptiert": "Yes"
  },
  "password": "geheim123"
}

Response

Filled PDF document

Changes

No recorded changes to this operation across all 1 revision of this API.