Merge PDFs
Try it interactively →POST /api/pdf-mergeMerge multiple PDFs into one. Lossless: pages are preserved verbatim with no re-rasterization. Optional title / author metadata for the resulting document.
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| pdfs* | file | — | Array of base64-encoded PDFs to concatenate, in order. |
| title | string | — | Optional Title metadata for the merged document. |
| author | string | — | Optional Author metadata for the merged document. |
| ignoreEncryption | boolean | — | Load PDFs flagged as encrypted anyway. Works for scanner / form-software output that's marked encrypted without a password; truly password-protected PDFs still fail. Default: false. |
Response
Modes: binary, json. Cache: yes (24h TTL).
Code samples
Built from the two-page-pair example.
# Download or substitute the example input:
# curl -O https://xtract.bot/examples/pdf-merge/hello.pdf
PDFS_0_=$(base64 -w0 < hello.pdf)
# Download or substitute the example input:
# curl -O https://xtract.bot/examples/pdf-merge/world.pdf
PDFS_1_=$(base64 -w0 < world.pdf)
curl -X POST https://api.xtract.bot/api/pdf-merge \
-H "Content-Type: application/json" \
-H "Accept: application/octet-stream" \
-H "X-Account-Id: $XTRACT_ACCOUNT_ID" \
-H "X-Api-Key: $XTRACT_API_KEY" \
-d '{
"title": "merged",
"pdfs[0]": "__BASE64_PDFS_0___",
"pdfs[1]": "__BASE64_PDFS_1___"
}'