Andrew August 31, 20200 Comments

How to redact PDF documents

How to redact PDF documents

August 31, 2020

Maintaining confidentiality in business documents is something that people in different fields and positions should be worried about.

If documents are used internally by a company or organization, then there is no need to hide any data. But when the document comes out, then you should read the edited document to make sure that there is no confidential or personal information in it. Confidential information may include:

  • Phone numbers, emails, social network accounts;
  • Social Security numbers. If you must include someone‚Äôs Social Security number, only use the last four digits.
  • Any financial account numbers.
  • The names of persons or minors.
  • Dates: dates of birth, recruiting for some projects, employments.
  • Addresses: home, addresses of private properties etc.

Each company or organization has its own document redaction policy. Here are some of the most general rules.

  • Use a copy of a document without touching the original. Never change the main or original version of an electronic record – make a copy.
  • Remove all intermediate versions and keep only the original and redacted version of the document.
  • The interval should not indicate missing information.
  • Words should not be visible or guessed due to incomplete editing.
  • Hold the paper near the light to check.

Redacting a PDF Document with Aspose.PDF Redaction application

Aspose.PDF team has developed a free application that allows you to edit documents. The user may have a reasonable question – is it safe to use this application. My answer is yes. This application does not store the original documents, but the results only for 24 hours after processing.

Let’s consider several ways to work with this application.

Removing exact matches of the text fragments

Removing exact matches is a simplest and common used operation. Let’s assume we have a document depict below and we want to remove name of the city (a highlighted fragment).

Sample of room rental reservation agreement
Sample of room rental reservation agreement

To do this, you need to upload a document and enter the desired fragment. If you want to replace the desired fragment with another, you should also enter the replacement fragment and press REDACT button.

PDF Redaction App with uploaded document and entered searched and replacement text fragment

After processing, we will get the following document. In case, if we leave the replacement field empty, the city name will simply disappear from the text.

Document with replaced fragment

Removing more complex text fragments

In our example, phone numbers are also present, and we can’t remove both numbers using an exact match.

In this case, we have to become a little programmer and use regular expressions. To learn more, you can follow to the tutorial, but in short, these are special notation for groups of characters with which you can describe certain lines or fragments of text.

So, what we can do to redact a phone numbers from our PDF:

  1. Go to Aspose.PDF Redact App;
  2. Upload the document;
  3. In the search field enter the regular expression for the phone numbers (?\d{3})?-? *\d{3}-? *-?\d{4}
  4. In the replacement field enter desired text or leave empty;
  5. Press the Redact button;
Redact phone numbers

Using regular expressions may seem unusual to a beginner, but you can always find ready-made rules on the web for various purposes. Here is the list of most popular regular expressions:

  • email – ^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$
  • links ^(http:\/\/www.|https:\/\/www.|http:\/\/|https:\/\/)?[a-z0-9]+([-.]{1}[a-z0-9]+).[a-z]{2,5}(:[0-9]{1,5})?(\/.)?$
  • social security numbers – ^\d{3}-\d{2}-\d{4}$

Leave a comment

Posted inNews, Aspose.PDF App Product FamilyTags: ,

Related Articles