Skip to main content

Redact a PDF

POST 

/pdf/redact

Removes what lies under rectangles of the pages, and every place where a text you name stands, from the file itself, not just from view: text is taken out (a line keeps its other words), the pixels of an image under a rectangle turn black, drawn shapes are cut, and a link or a comment a rectangle or a found text touches goes whole, with its address. A box in fill is drawn over each rectangle and each found text, black unless you name another colour or null. Rectangles are given as a viewer shows the page: points from its top-left corner, y running down, the page's rotation applied (72 points are an inch, about 2.83 a millimetre). A text in text is found on every page, in form fields too, whatever its whitespace (DE36000000… finds an IBAN printed in groups of four), ignoring case unless match_case is true, and only as a whole word with whole_words. Afterwards Formfeed reads the result again and answers 422 redaction_incomplete, delivering no file, while text still lies under a rectangle, a named text can still be found on a page or in the document's metadata, bookmarks, attachments, form or annotations, or the file keeps an earlier revision; the problem names rectangles and texts by their number, never a text. A text that does not occur is no error. The source is a stored PDF named as source in a JSON body, or an upload as multipart/form-data with the PDF as file (never stored). Costs 0.5 units on live keys; Starter plan and above. A PDF/A answers 422 source_invalid, a signed or password-protected PDF 422 source_invalid or source_encrypted, a rectangle that covers part of a form field 422 invalid_request. Needs render:create.

Request​

Responses​

The render of the redacted PDF.