ByteScout Sensitive Data Suite - C# - Black out PII Data From PDF - ByteScout

ByteScout Sensitive Data Suite – C# – Black out PII Data From PDF

  • Home
  • /
  • Articles
  • /
  • ByteScout Sensitive Data Suite – C# – Black out PII Data From PDF

black out PII data from PDF in C# with ByteScout Sensitive Data Suite

Learn to code in C# to make black out PII data from PDF with this simple How-To tutorial

ByteScout tutorials describe the stuff for programmers who use C#. ByteScout Sensitive Data Suite was created to assist black out PII data from PDF in C#. ByteScout Sensitive Data Suite is the set that includes SDK tools from ByteScout for working with sensitive and personal data. With these tools you may analyze, redact, remove, blackout sensitive data in documents and pdf.

If you want to quickly learn then these fast application programming interfaces of ByteScout Sensitive Data Suite for C# plus the guideline and the C# code below will help you quickly learn black out PII data from PDF. To use black out PII data from PDF in your C# project or application just copy & paste the code and then run your app! C# application implementation mostly involves various stages of the software development so even if the functionality works please check it with your data and the production environment.

Trial version can be downloaded from our website for free. It contains this and other source code samples for C#.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

Program.cs
      
using System; using System.Drawing; using Bytescout.PDFExtractor; namespace BlackOutPIIDataFromPDF { class Program { static void Main(string[] args) { // Create Bytescout.PDFExtractor.Remover2 instance Remover2 remover = new Remover2("demo", "demo"); // Mask removed text, which ultimately black out region remover.MaskRemovedText = true; // Load sample PDF document remover.LoadDocumentFromFile(@"samplePDF_SSNNo.pdf"); // Prepare TextExtractor using (TextExtractor textExtractor = new TextExtractor("demo", "demo")) { // Load document into TextExtractor textExtractor.LoadDocumentFromFile(@"samplePDF_SSNNo.pdf"); // Search SSN in format 202-55-0130 // See the complete regular expressions reference at https://msdn.microsoft.com/en-us/library/az24scfc(v=vs.110).aspx string regexPattern = "[0-9]{3}-[0-9]{2}-[0-9]{4}"; // Enable RegexSearch textExtractor.RegexSearch = true; // Set word matching options textExtractor.WordMatchingMode = WordMatchingMode.None; // Search results ISearchResult[] searchResults = textExtractor.FindAll(0, regexPattern, caseSensitive: false); // Remove text objects find by SearchResults. remover.AddTextToRemove(searchResults); // Perform removal of specified objects remover.PerformRemoval(@"result1.pdf"); } // Open output file in default application System.Diagnostics.Process.Start("result1.pdf"); // Clean up. remover.Dispose(); } } }

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Sensitive Data Suite Home Page

Explore ByteScout Sensitive Data Suite Documentation

Explore Samples

Sign Up for ByteScout Sensitive Data Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Sensitive Data Suite Home Page

Explore ByteScout Sensitive Data Suite Documentation

Explore Samples

Sign Up for ByteScout Sensitive Data Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

prev
next