VaultDocs
3 min read

How to Redact a PDF Offline on a Mac (Securely)

A step-by-step guide to permanently redacting PDFs on macOS without uploading anything. Covers Preview's limits and a truly secure offline workflow.

Redacting a PDF on a Mac sounds simple — draw a black box over the sensitive part and save. The problem is that the "obvious" approach leaves the original text sitting underneath the box, fully selectable and searchable. This guide shows how to redact on macOS so the data is actually gone, without uploading your document to any website.

Why the black-box trick fails

When you draw a filled rectangle over text in most PDF editors, you add a drawing on top of a layer that still contains the original characters. Anyone can:

  • Select the text under the box and copy it.
  • Run pdftotext and read everything.
  • Open the file in another viewer that renders layers differently.

Real redaction must remove the underlying content, not just hide it.

Option 1: Preview (built-in, with a critical extra step)

macOS Preview does not have a true redaction tool, but you can approximate one safely if you flatten afterward.

  1. Open the PDF in Preview.
  2. Use Tools → Annotate → Rectangle, set both the border and fill to solid black, and cover each sensitive area.
  3. This is not yet safe — the text is still underneath.
  4. Flatten the file so the boxes become part of a rasterized page: File → Export…, choose PDF, and in the Quartz filter options export as images, or print to PDF (see next step).

Flatten with Print to PDF

  1. File → Print.
  2. Click the PDF dropdown in the lower-left → Save as PDF.
  3. Save a new file.

Printing to PDF rasterizes the visible page in many cases, but it is not guaranteed to drop the text layer. Always verify (see below). If text is still selectable, use Option 2.

Option 2: Rasterize to guarantee removal

The most reliable offline method is to convert each page to an image and rebuild the PDF. Once a page is an image, there is no hidden text layer at all.

Using the built-in sips tool and qpdf/ghostscript (install via Homebrew: brew install ghostscript qpdf):

# Flatten a redacted PDF by rasterizing every page at 200 DPI
gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER \
   -r200 -dPDFSETTINGS=/prepress \
   -o redacted-flat.pdf input-with-black-boxes.pdf

For a guaranteed image-only output:

# Convert to images then back to a single PDF (requires imagemagick: brew install imagemagick)
magick -density 200 input-with-black-boxes.pdf page-%03d.png
magick page-*.png redacted-flat.pdf
rm page-*.png

Because the final PDF is built from images, the original text cannot be recovered.

Don't forget the metadata

Redacting the visible content is only half the job. PDFs carry metadata — author name, software, timestamps, and sometimes previous revisions. Strip it:

exiftool -all:all= redacted-flat.pdf    # brew install exiftool

Verify your work

Never trust the preview. Confirm the data is gone:

# If this prints the "redacted" words, your redaction failed.
pdftotext redacted-flat.pdf - | grep -i "the-secret-word"

# Check for leftover metadata
exiftool redacted-flat.pdf

Also open the file in a different app (Chrome, Acrobat Reader) and try to select text under each box.

Key takeaways

  • A black rectangle is not redaction — it only hides text.
  • Rasterizing pages (image-only PDF) is the most reliable offline guarantee.
  • Always strip metadata after redacting.
  • Verify with pdftotext and a second viewer before sending anything.

Everything above runs entirely on your Mac. Nothing is uploaded, which is exactly how sensitive documents should be handled.

Keep reading