Merge, rasterize, and sign PDFs¶
These endpoints operate on existing files. The JSON contract uses base64 for binary inputs. HTTP responses that contain PDF bytes can be saved directly.
Merge PDFs¶
Send the PDFs in the order you want their pages to appear.
first="$(base64 < invoice.pdf | tr -d '\n')"
second="$(base64 < terms.pdf | tr -d '\n')"
jq -n --arg first "$first" --arg second "$second" \
'{version: 1, pdfs: [$first, $second]}' |
curl --fail-with-body http://127.0.0.1:8080/v1/merge \
-H "Authorization: Bearer $PRESSJET_API_KEY" \
-H 'Content-Type: application/json' \
--data-binary @- -o packet.pdf
This example is for small files. Use an SDK for production uploads and check the server's upload and response limits.
Rasterize an existing PDF¶
Send {"version":1,"bytes":"<base64>","options":{"scale":1,"maximumPages":1}} to POST /v1/rasterize to request page one. The JSON response contains one PNG per requested page. To preview a document that the API has yet to render, use the preview endpoint.
Sign the final packet¶
Configure a server-side signing certificate before calling POST /v1/sign. Send the PDF and a signature object with name, reason, and an RFC 3339 signingTime. Attach or merge any supporting pages before signing the final bytes. For a multi-party approval flow, read the native signing pilot.
The OpenAPI contract describes exact fields, options, and response types.