Strip the invisible: JavaScript actions, open-actions, form fields and embedded files are removed and the file is rewritten, so orphaned objects are gone too. The counterpart to redact before handing a document out.
| Name | Type | Description |
|---|---|---|
file | file · required | PDF to clean. |
flatten | boolean · optional | Flatten annotations and form fields, default true. |
removeAttachments | boolean · optional | Default true. |
removeMetadata | boolean · optional | Also clear title/author/producer, default false. |
curl -X POST https://api.bigapi.dev/v1/pdf/sanitize -H 'Authorization: Bearer $KEY' -F 'file=@case-file.pdf' -o clean.pdf
HTTP/1.1 200 OK Content-Type: application/pdf X-BigAPI-Sanitized: annotations,attachments(1),javascript,open-action,form-fields X-BigAPI-Pages: 12 (cleaned PDF – the removed objects are gone from the bytes, not just unlinked)
Deleting the reference to a JavaScript action is not enough: the object itself stays in the file and can still be read with a hex editor. This operation therefore rewrites the document from the objects that are actually reachable — what nothing points to any more is physically gone.