PDF form filler API

List the fields of a fillable PDF, fill them from JSON with full Vietnamese text, flatten the result and batch-fill many forms into a zip.

POSThttps://apibox.io.vn/v1/pdf-form

Upload a fillable PDF (AcroForm) and the API lists its fields: name, type (text, checkbox, radio, dropdown, list box, signature, button), current value, options, maximum length and the page and position of each widget, plus a template object you can fill in. Send values as {"field name": value} to fill it: text, true / false for checkboxes, an option (or its index) for radio groups and dropdowns, an array for list boxes.

Appearances are regenerated with the Be Vietnam Pro font embedded, so Vietnamese diacritics display correctly in every viewer (the standard PDF fonts cannot show them). flatten=true burns the values into the page and removes the fields, for a final, non-editable copy. rows fills the same form once per object and returns a zip, named with filename such as don_{ho_ten}.

Unknown field names are ignored and reported (x-unknown-fields header, or an error with strict=true). XFA-only forms and scanned PDFs without fields cannot be filled; encrypted PDFs are refused. Files are processed in memory and not stored.

Parameters

NameInTypeRequiredDefault
filebodyfileyesThe PDF form (multipart, raw body or file_base64).
actionbody|querystringnofieldsfields (list) or fill (default when values / rows are sent).
valuesbodyobjectno{"field name": value} to fill one copy.
rowsbodyarraynoBatch fill: array of value objects, returns a zip (max 200).
flattenbody|querybooleannofalseBurn values into the page and remove the fields.
strictbody|querybooleannofalseFail on unknown field names.
outputbody|querystringnopdfpdf (file) or json (base64 + filled field list).

Example

curl -X POST "https://apibox.io.vn/v1/pdf-form" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "0=@./my-file"

Response

{
  "pages": 1,
  "xfa": false,
  "field_count": 5,
  "fields": [
    {
      "name": "ho_ten",
      "type": "text",
      "read_only": false,
      "required": false,
      "value": null,
      "max_length": null,
      "multiline": false,
      "widgets": [
        {
          "page": 1,
          "x": 119.5,
          "y": 749.5,
          "width": 301,
          "height": 23
        }
      ]
    },
    {
      "name": "dong_y",
      "type": "checkbox",
      "read_only": false,
      "required": false,
      "value": false,
      "widgets": [
        {
          "page": 1,
          "x": 119.5,
          "y": 639.5,
          "width": 15,
          "height": 15
        }
      ]
    },
    {
      "name": "gioi_tinh",
      "type": "radio",
      "read_only": false,
      "required": false,
      "value": null,
      "options": [
        "Nam",
        "Nu"
      ],
      "widgets": [
        {
          "page": 1,
          "x": 119.5,
          "y": 609.5,
          "width": 15,
          "height": 15
        },
        {
          "page": 1,
          "x": 159.5,
          "y": 609.5,
          "width": 15,
          "height": 15
        }
      ]
    },
    {
      "name": "tinh",
      "type": "dropdown",
      "read_only": false,
      "required": false,
      "value": null,
      "options": [
        "Hà Nội",
        "TP. Hồ Chí Minh",
        "Đà Nẵng"
      ],
      "editable": false,
      "widgets": [
        {
          "page": 1,
          "x": 119.5,
          "y": 569.5,
          "width": 201,
          "height": 23
        }
      ]
    },
    {
      "…": "…"
    }
  ],
  "template": {
    "ho_ten": "",
    "dia_chi": "",
    "dong_y": false,
    "gioi_tinh": "",
    "tinh": ""
  },
  "note": "Fill with action=fill and values={\"field name\": \"value\"}. Coordinates are PDF points from the bottom-left corner."
}

Use cases

  • Fill bank, insurance or visa application PDFs from a database
  • Generate signed-off flat copies of internal forms
  • Batch-fill certificates or tax forms for many people
  • Inspect field names before automating a PDF workflow

FAQ

Why are Vietnamese characters shown correctly?

Field appearances are redrawn with an embedded Vietnamese-capable font (Be Vietnam Pro, OFL licence) instead of the standard Helvetica, which has no Vietnamese glyphs.

What does flatten do?

It draws the filled values into the page content and removes the form fields, so the PDF can no longer be edited in a viewer.

Which PDFs cannot be filled?

Scanned or flat PDFs without form fields, XFA-only forms (LiveCycle) and password-protected files.

Related APIs

Start with 1,000 free requests every month. Get free API key →