apyhub
Back

Convert Fillable PDF to Locked PDF API

What it does

PDF Flattening turns a fillable PDF into a locked, non-editable PDF. Send the PDF file in the request body and get a binary PDF back with the form fields flattened into the document.

Use PDF Flattening when you need to preserve what a user entered before archiving, sharing, or sending the file into a workflow that should not allow further edits. It is a practical fit for signed forms, applications, intake sheets, invoices, and other documents where the filled-in content should become part of the page content.

The endpoint accepts one input: file, a PDF binary up to 20 MB. The response is the flattened PDF as a binary file, so you can store it, forward it, or attach it to another system without adding another conversion step.

If your application collects PDFs from users and needs a locked final copy, PDF Flattening gives you that output directly from the uploaded document.

POST
Flatten a PDF
https://api.eu.apyhub.com/freedailypro/convert-fillable-pdf-to-locked-pdf/flatten

QUICKSTART

GUIDE

Quickstart

Upload a PDF to flatten its fillable fields into a locked version.

curl -X POST "https://api.eu.apyhub.com/freedailypro/convert-fillable-pdf-to-locked-pdf/flatten" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/document.pdf"

What you'll get back

Returns a binary file (string with format: binary), which is the flattened PDF.

TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*
The PDF. Up to 20 MB.

About this endpoint

What it does

Flattens a fillable PDF by taking a PDF file as input and returning a binary PDF file as the result. The output is a locked/flattened PDF stream rather than a JSON object.

Request Body

ParameterTypeMandatoryDescription
fileStringYesThe PDF. Up to 20 MB.

Response

Returns a binary file response containing the flattened PDF. The output schema is a single binary string, so there are no JSON fields to document.

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.