Redacting text, images, and other data within a PDF file in an automated and efficient manner can be difficult to do at the scale required by large enterprises. Given the importance of maintaining data privacy and regulations such as the Freedom of Information Act, this can be a real problem for large organizations dealing with a wealth of sensitive data. Fortunately, solutions like DocGenius™ Redactor by ActivePDF enables users to remove or obscure data within a PDF file in a programmatic and scalable fashion.
In this article, we’ll provide you with a simple walkthrough demonstrating how Redactor can programmatically redact data within a PDF file. We’ll start with the “hello_world.pdf” file below to show how to redact selected text using the Redactor tool.
In the following 8-step redaction tutorial, keep an eye on the instances of the word “lorem." At the end of this process, every "lorem" will be redacted, resulting in a clear demonstration of the power and extensibility of ActivePDF Redactor.
Start your Free Trial of Redactor now:
How to Redact a PDF File
- Download and install ActivePDF Redactor. Before installing the software, be sure that your computer meets the following system requirements:
- Microsoft Windows® 7, 8.1, or 10
- Windows Server® 2008 R2, 2012 R2, or 2016
- Microsoft® .NET Framework 4.5
- 512MB RAM
- 150MB hard disk space for the application
- Download Redactor's sample code from GitHub.
- Place the example code in the C:\Program Files\ActivePDF\Redactor directory. Note: the directory locations can be modified if needed. For the sake of this tutorial, we'll assume use of default directories.
- Edit Program.cs to uncomment the scripts you would like to execute. In our example, we’ll uncomment the "Sample.RedactTexts.RedactText_(); line."
- Edit the uncommented scripts as desired to make your redactions. In our example, we’ll edit RedactText.cs to redact the text "lorem" from the file hello_world.pdf, and save the contents in the OutPutFiles directory as RedactTextOutPut.pdf.
- Place the file to be redacted (in this case "hello_world.pdf") in the C:\Program Files\ActivePDF\Redactor\Redactor_Examples_CSharp-master\bin\Debug\InputFiles directory.
- Execute the sample ConsoleApplication1 program. Here we simply start the program from within Microsoft Visual Studio®.
- RedactTextOutPut.pdf, a copy of "hello_world.pdf" with the text "lorem" redacted will be saved in the C:\Program Files\ActivePDF\Redactor\Redactor_Examples_CSharp-master\bin\Debug\OutPutFiles directory. As you can see below, all instances of the word "lorem" are now redacted.
.NET PDF Redaction API
This easy 8-step tutorial clearly demonstrates that Redactor is a highly flexible and extensible .NET API that can be leveraged to meet most enterprise document redaction tasks.
By adding variables to the sample scripts or embedding Redactor as a part of a larger program or workflow, developers can significantly streamline their document redaction processes and ease the cost of complying to the Freedom of Information Act and other related e-Discovery requests.
PDF Redaction Summary
Be sure to review Redactor's sample code and knowledgebase for more advanced examples in C# and Visual Basic (e.g. changing color, redact money, redact events , excluding regex, redact by region, and more).
To learn more about Redactor, or other digital transformation solutions, contact the knowledgeable technical advisors at ActivePDF: