Skip to main content

Flatten PDFs

Makes the PDF non-interactive.

This process merges all interactive form fields (text inputs, checkboxes, etc.) directly into the page content. The resulting PDF cannot be modified by the end-user.

POST/forms/pdfengines/flatten
Gotenberg-Output-Filenamestring
The filename of the resulting file - Gotenberg automatically appends the file extension. Defaults to a random UUID filename.
Gotenberg-Tracestring
A custom request ID to identify the request in the logs; overrides the default UUID.
filesfile[]required
PDF files to flatten.
cURL
curl \
--request POST http://localhost:3000/forms/pdfengines/flatten \
--form files=@/path/to/form.pdf \
-o my.pdf
The flattened PDF file.
Content-Disposition: attachment; filename={output-filename.pdf}
Content-Type: {content-type}
Content-Length: {content-length}
Gotenberg-Trace: {trace}
Body: {output-file}