Skip to content
HALOWERK

Formatwerk

pdf true redact

Own content-stream rewriter on top of pdf-lib 1.17.1 (ISO 32000-2 §9.4): glyphs whose box centre lies in an area, or that overlap it by at least 30 %, are cut out of Tj/TJ/'/" and replaced by TJ displacements, so the remaining text keeps its exact position. Glyph widths come from /Widths, CID /W arrays with Identity or embedded CMaps, or the AFM metrics of the standard 14 fonts (pdf-lib standard-fonts, encodings per Annex D). Form XObjects over an area are rewritten as copies, so other pages.

POST https://format.halowerk.com/v1/pdf-true-redact

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
content_base64stringNoThe PDF as base64 (a data: prefix and whitespace are tolerated); at most 10 MB decoded.
urlstringNoPublic http(s) URL of the PDF (at most 10 MB). Private, local and reserved addresses are refused.
areasarrayNoRectangles to redact in PDF points, origin at the bottom-left of the page user space (as in the MediaBox).
termsarrayNoText to redact wherever it occurs; whitespace inside a term matches any whitespace.
case_sensitivebooleanNoMatch terms case-sensitively.
markstringNoDraw black boxes over the areas or leave them blank.
remove_metadatabooleanNoRemove the document information dictionary and XMP metadata.
remove_attachmentsbooleanNoRemove embedded files and file attachment annotations.
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "content_base64": {
      "type": "string",
      "minLength": 8,
      "maxLength": 13981016,
      "description": "The PDF as base64 (a data: prefix and whitespace are tolerated); at most 10 MB decoded."
    },
    "url": {
      "type": "string",
      "format": "uri",
      "maxLength": 2048,
      "description": "Public http(s) URL of the PDF (at most 10 MB). Private, local and reserved addresses are refused."
    },
    "areas": {
      "type": "array",
      "maxItems": 500,
      "description": "Rectangles to redact in PDF points, origin at the bottom-left of the page user space (as in the MediaBox).",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "page",
          "rect"
        ],
        "properties": {
          "page": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100000,
            "description": "1-based page number."
          },
          "rect": {
            "type": "array",
            "minItems": 4,
            "maxItems": 4,
            "items": {
              "type": "number",
              "minimum": -100000,
              "maximum": 100000
            },
            "description": "[x0, y0, x1, y1] with x1 > x0 and y1 > y0."
          }
        }
      }
    },
    "terms": {
      "type": "array",
      "maxItems": 50,
      "items": {
        "type": "string",
        "minLength": 2,
        "maxLength": 200
      },
      "description": "Text to redact wherever it occurs; whitespace inside a term matches any whitespace."
    },
    "case_sensitive": {
      "type": "boolean",
      "default": false,
      "description": "Match terms case-sensitively."
    },
    "mark": {
      "type": "string",
      "enum": [
        "black",
        "none"
      ],
      "default": "black",
      "description": "Draw black boxes over the areas or leave them blank."
    },
    "remove_metadata": {
      "type": "boolean",
      "default": true,
      "description": "Remove the document information dictionary and XMP metadata."
    },
    "remove_attachments": {
      "type": "boolean",
      "default": false,
      "description": "Remove embedded files and file attachment annotations."
    }
  }
}

Open original schema

Published input example

{
  "content_base64": "JVBERi0xLjcKJYGBgYEKCjYgMCBvYmoKPDwKL0ZpbHRlciAvRmxhdGVEZWNvZGUKL0xlbmd0aCAyODMKPj4Kc3RyZWFtCnicdZBBS8QwEIXv8yvmLHR3MpmZpCDCalsVvKi5iQdZV1EssiL695202oMoIc3k6+S9l+zhuABhHW+PsD7bvXzs3p+2d02bhC2zWsbAWB6ABcsFhKk1YGJMRFhGOJTegnWmccMkGxssW8+k0ZmLuMaJ81ZYgjgXEY05tkwxxhQpild1yHelznmqglc0/z3C8gzlAPoCl7D/P7OSmEsnDPRnZklzZk/XWrLe1NzV65osJfb0fpukzobKYnDe25DMOztj01SzcazTfqX68YmkKKy4HRdUv8u2WfbTJVaGV6cQVoqfcHPr5H7iIzC5FIof8MWmI+D5g2KuIoQtobvA9exO85PUtU6myWJ9PjZZlEKm4O/SvXrzF59hZ0YKZW5kc3RyZWFtCmVuZG9iagoKOCAwIG9iago8PAovVHlwZSAvWE9iamVjdAovU3VidHlwZSAvSW1hZ2UKL1dpZHRoIDEwMAovSGVpZ2h0IDEwMAovQ29sb3JTcGFjZSAvRGV2aWNlUkdCCi9CaXRzUGVyQ29tcG9uZW50IDgKL0ZpbHRlciAvRmxhdG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uZ3RoIDQ3Ci9XIFsgMSAyIDIgXQovSW5kZXggWyAwIDExIF0KPj4Kc3RyZWFtCnicY2Bg+P+fiYGTgQFEMIIIJhDBDCJYGBkEIBKsjIwlDEDpQCDBso+BAQB92wPuCmVuZHN0cmVhbQplbmRvYmoKCnN0YXJ0eHJlZgoxMjE0CiUlRU9G",
  "terms": [
    "DE89 3704 0044 0532 0130 00"
  ]
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.

More endpoints in this hub

All endpoints in this hub →