ByteScout PDF Extractor SDK - C# - Remove Text from PDF - ByteScout

ByteScout PDF Extractor SDK – C# – Remove Text from PDF

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Extractor SDK – C# – Remove Text from PDF

How to remove text from PDF in C# and ByteScout PDF Extractor SDK

How to code in C# to remove text from PDF with this step-by-step tutorial

Learn how to remove text from PDF in C# with this source code sample. ByteScout PDF Extractor SDK is the SDK is designed to help developers with pdf tables and pdf data extraction from unstructured documents like pdf, tiff, scans, images, scanned and electronic forms. The library is powered by OCR, computer vision and AI to provide unique functionality like table detection, automatic table structure extraction, data restoration, data restructuring and reconstruction. Supports PDF, TIFF, PNG, JPG images as input and can output CSV, XML, JSON formatted data. Includes full set of utilities like pdf splitter, pdf merger, searchable pdf maker and other utilities and you can use it to remove text from PDF with C#.

C# code samples for C# developers help to speed up coding of your application when using ByteScout PDF Extractor SDK. Just copy and paste the code into your C# application’s code and follow the instruction. You can use these C# sample examples in one or many applications.

Our website provides trial version of ByteScout PDF Extractor SDK for free. It also includes documentation and source code samples.

Try ByteScout PDF Extractor SDK today: Get 60 Day Free Trial or sign up for Web API

Program.cs
      
using System; using System.Drawing; using Bytescout.PDFExtractor; namespace RemoveText { class Program { static void Main(string[] args) { // Create Bytescout.PDFExtractor.Remover instance Remover remover = new Remover("demo", "demo"); // Load sample PDF document remover.LoadDocumentFromFile(@"sample1.pdf"); // Remove text "LOREM IPSUM" and save edited document as "result1.pdf". // NOTE: The removed text might be larger than the search string. Currently the Remover deletes // the whole PDF text object containing the search string. remover.RemoveText(0, "LOREM IPSUM", true, @"result1.pdf"); // Remove text objects contained in the specified rectangle or intersecting with it. // NOTE: The removed text might be larger than the specified rectangle. Currently the Remover is unable // to split PDF text objects. remover.RemoveText(0, new RectangleF(74f, 550f, 489f, 67f), @"result2.pdf"); // Remove text object contained in the specified point. // NOTE: The removed text might be larger than a word in the specified point. Currently the Remover is able // to remove only the whole PDF text object containing the word. remover.RemoveText(0, new PointF(121f, 230f), @"result3.pdf"); // Clean up. remover.Dispose(); } } }

Try ByteScout PDF Extractor SDK today: 60 Day Free Trial (on-premise version) or sign up for Web API (on demand version)

VIDEO

ON-PREMISE VERSION

Get 60 Day Free Trial or Visit ByteScout PDF Extractor SDK page

Explore ByteScout PDF Extractor SDK documentation

WEB API

Sign Up for free Web API key

Explore Web API Documentation

Tutorials:

prev
next