Fill a PDF form
POST/pdf/fill
Fills the fields of a PDF form by their full names, as /pdf/info lists them, and keeps the
form fillable, or with flatten draws the values into the pages and removes the fields. A
value is text for a text field, a number too, true or false for a check box, an option
for a dropdown, a radio group or a check box with several on-values (/pdf/info lists them
as options), and a list of options for a list box that takes several. In strict mode, the
default, a name the form lacks answers 422 form_field_unknown and a value its field does not
take 422 form_value_invalid, both naming the field and never the value; with strict: false both are left out and listed in the render's form.skipped. No calculation or
display format of the form runs: the render's form.warnings names the fields that have one.
A form that opens without a password but restricts editing is filled where its restrictions
allow filling and keeps them; one that needs a password answers source_encrypted, a signed
one form_signed, an XFA form form_xfa_unsupported, a hybrid one is filled through its
AcroForm with its XFA part removed. Values in Chinese, Japanese or Korean drawn by flatten
add about 1.3 MB of font to the file. The source is a stored PDF named as source in a JSON
body, or an upload as multipart/form-data with the PDF as file (never stored). The values
are never stored; the render keeps the field names. Costs 0.5 units on live keys; Starter plan
and above. Needs render:create.
Request
Responses
- 200
- 413
- 415
- 422
- 429
- 503
- default
The render of the filled PDF, with form saying what it filled.
The upload is larger than the plan's output size or 100 MB.
file_type_unsupported: the upload is no PDF.
form_field_unknown and form_value_invalid (naming the field, and for a value the rule it broke), form_xfa_unsupported, form_filling_not_permitted, form_signed, source_not_found, source_invalid (unreadable, or a PDF/A), source_encrypted, page_limit_exceeded or output_too_large.
rate_limited: the workspace's bucket of the plan's requests per second is empty (Free test keys also have 30 a minute). The problem names the bucket's limit and its window_seconds. Retry after Retry-After seconds.
Response Headers
Seconds until a request is let through again.
Size of the workspace's request bucket: the plan's requests per second. Free test keys are also held to 30 requests a minute, and the headers then describe whichever bucket is closer to empty.
Requests left in the bucket.
Seconds until the bucket is full again.
tool_unavailable: the PDF tools are busy; retry after Retry-After seconds.
Error (RFC 9457 problem details).