Jacob Collins Jacob is the JPedal Product Lead and specialises in PDF creation and manipulation. He also develops Salesforce backend systems and contributes to marketing and support. Outside of work, he’s a 1900‑rated chess player, guitarist, and French learner.

How to redact PDF text with the JPedal Viewer

1 min read

redacted pdf

TL;DR

The JPedal PDF Viewer can be used to redact text in PDF documents. Select ‘Redact’ from the tools menu and draw a rectangle over the desired text.

What is redaction and why should you use it?

Redaction is the process of removing sensitive information from a document so that it is suitable for publishing. It is commonly used in legal or government processes when documents are made available to the public while keeping certain details hidden.

If you want to publish parts of a document and have certain secrets remain secrets, then redaction is the right tool to use.

How Redaction in PDFs Works

Redaction typically consists of a black rectangle which covers up the text you want hidden. Traditionally, this was done by drawing over text with a black marker and then scanning it back in.

In the age of digital media, the concept is the same, but care must be taken to ensure that the content is actually removed and cannot be recovered through some sneaky techniques.

Pitfalls of Weak Digital Redaction Tools

  • One common mistake with low-quality redaction tools is drawing a black box over the text, but leaving the text remaining underneath. Other tools may then allow people to remove the boxes and see the text that was there, or you may just see that large characters like j may poke out of top or bottom of the black box.
  • Another mistake is replacing the text with empty characters of the same width. This is done to preserve the layout of subsequent characters, however it is possible to reserver engineer what text used to be there by looking at the widths of the blank characters and comparing them with the widths from the font. Ideally, any blank spacing should be accumulated so not to leak any information.
  • Finally, a common pitfall to be aware of is that sometimes you can simply figure out what used to be there based on context e.g. “Jane ■■■” appears in one place, but “Jane Doe” appears nearby.

How to redact text using the JPedal Viewer

The JPedal Viewer has a tools menu which contains various operations you can perform on the currently opened document.

The tools menu is hidden by default, so you will need to enable it by going to edit -> preferences -> menu, and selecting tools.

Now that the tools menu is visible, you can open a PDF document in the JPedal Viewer, navigate to the desired page, and select redact from the tools menu.

redact text in the jpedal viewer

This will bring up a dialog box to confirm which page you want to draw over, press OK to confirm.

You can now drag a rectangle over the area you want to redact. Any text that intersects this rectangle will be removed and a black box will take its place.

redacted pdf

Download JPedal

You can download a copy of the JPedal jar from our website and get started using the JPedal Viewer as a PDF redaction tool.

Resources

  • How to manipulate PDF files from the JPedal Viewer.
  • Learn more about Viewing PDF files in Java.
  • We can help you better understand the PDF format as developers who have been working with the format for more than 2 decades!


  • The JPedal PDF library allows you to solve these problems in Java


    Jacob Collins Jacob is the JPedal Product Lead and specialises in PDF creation and manipulation. He also develops Salesforce backend systems and contributes to marketing and support. Outside of work, he’s a 1900‑rated chess player, guitarist, and French learner.