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.
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
| Name | In | Type | Required | Default | |
|---|---|---|---|---|---|
file | body | file | yes | The PDF form (multipart, raw body or file_base64). | |
action | body|query | string | no | fields | fields (list) or fill (default when values / rows are sent). |
values | body | object | no | {"field name": value} to fill one copy. | |
rows | body | array | no | Batch fill: array of value objects, returns a zip (max 200). | |
flatten | body|query | boolean | no | false | Burn values into the page and remove the fields. |
strict | body|query | boolean | no | false | Fail on unknown field names. |
output | body|query | string | no | pdf | pdf (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"const form = new FormData();
form.append('0', fileInput.files[0]);
const res = await fetch('https://apibox.io.vn/v1/pdf-form', {
method: 'POST',
headers: { Authorization: 'Bearer YOUR_API_KEY' },
body: form,
});
console.log(await res.json());import requests
res = requests.post(
"https://apibox.io.vn/v1/pdf-form",
headers={"Authorization": "Bearer YOUR_API_KEY"},
files={"0": open("my-file", "rb")},
timeout=30,
)
print(res.json())<?php
$ch = curl_init('https://apibox.io.vn/v1/pdf-form');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
CURLOPT_POSTFIELDS => ['0' => new CURLFile('my-file')],
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));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
Image Metadata & EXIF
Read image dimensions, format, EXIF camera data, capture settings and GPS location from JPEG, PNG, WebP, HEIC, AVIF, GIF and more – upload or URL.
PDFPDF Metadata
Read PDF metadata: page count, title, author, creator, producer, dates, PDF version, encryption, form fields and the size of each page (A4, Letter…).
PDF₫Quote & Receipt PDF
Generate clean PDF quotations, receipts, orders and simple invoices from JSON, with Vietnamese text, VAT, totals in words and a VietQR code for payment.