PDF

Repair a damaged PDF

Fixes a PDF that will not open or says the file is damaged (a broken or missing internal index, a download cut off near the end, wrong offsets) by rebuilding its structure with qpdf, and returns a clean PDF with everything that could be read. It repairs structure, not content: pages whose data is missing from the file cannot be recovered, and meta.pages tells you how many come out. A healthy PDF comes back as an equivalent copy (meta.repaired is false). A password-protected PDF must be unlocked first with /pdf-unprotect. If nothing can be recovered the call returns 422 and the credit is not charged.

Costs 1 credit per call.

post/pdf-repair

Request

  • Base URL: https://api.cofferdock.com
  • URL: https://api.cofferdock.com/pdf-repair
  • Auth: API key in header x-api-key

Request body

filestring byte required

The damaged PDF to repair, base64-encoded. The "%PDF-" marker must appear in the first 1024 bytes of the file.

output'json' | 'binary' | 'url' | 'pdf'

How to return the PDF: "json" (base64 in the JSON response), "binary" (the PDF itself, ready for n8n/Make/Zapier) or "url" (a temporary download link, valid 15 minutes). Default: json when the request is JSON, binary when the input was sent raw.

Response

Result.

successboolean
pdfstring byte

Changes

No recorded changes to this operation across all 1 revision of this API.