ByteScout Premium Suite - C# - Data Masking in PDF with PDF Extractor SDK - ByteScout

ByteScout Premium Suite – C# – Data Masking in PDF with PDF Extractor SDK

  • Home
  • /
  • Articles
  • /
  • ByteScout Premium Suite – C# – Data Masking in PDF with PDF Extractor SDK

data masking in PDF with PDF extractor SDK in C# and ByteScout Premium Suite

Simple tutorial on how to do data masking in PDF with PDF extractor SDK in C#

Here you may get thousands pre-made source code samples for simple implementation in your own programming C# projects. ByteScout Premium Suite was created to assist data masking in PDF with PDF extractor SDK in C#. ByteScout Premium Suite is the set that includes 12 SDK products from ByteScout including tools and components for PDF, barcodes, spreadsheets, screen video recording.

This rich and prolific sample source code in C# for ByteScout Premium Suite contains various functions and options you should do calling the API to implement data masking in PDF with PDF extractor SDK. To use data masking in PDF with PDF extractor SDK 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.

Visit our website to get a free trial version of ByteScout Premium Suite. Free trial contains many of source code samples to help you with your C# project.

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 Bytescout.PDFExtractor; using System; using System.Diagnostics; using System.IO; using System.Text.RegularExpressions; namespace RepairText { class Program { static void Main(string[] args) { try { // Generate CSVExtractor instance using (CSVExtractor extractor = new CSVExtractor("demo", "demo")) { // Load PDF document extractor.LoadDocumentFromFile("sample.pdf"); // Get all data string allData = extractor.GetCSV(); // Regular expressions and replacements string ssnRegex = @"\d{3}[-]?\d{2}[-]?\d{4}"; string ssnReplace = "***-**-****"; string phoneRegex = @"\d{3}[-]?\d{3}[-]?\d{4}"; string phoneReplace = "***-***-****"; // Find and mask SSN and phone numbers allData = Regex.Replace(allData, ssnRegex , ssnReplace); allData = Regex.Replace(allData, phoneRegex, phoneReplace); // Write as CSV File.WriteAllText("output.csv", allData); // Open file ProcessStartInfo processStartInfo = new ProcessStartInfo("output.csv"); processStartInfo.UseShellExecute = true; Process.Start(processStartInfo); } } catch (Exception ex) { Console.WriteLine(ex.Message); } Console.WriteLine("Press enter key to close..."); Console.ReadLine(); } } }

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Premium Suite Home Page

Explore ByteScout Premium Suite Documentation

Explore Samples

Sign Up for ByteScout Premium 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 Premium Suite Home Page

Explore ByteScout Premium Suite Documentation

Explore Samples

Sign Up for ByteScout Premium Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next