ByteScout PDF Extractor SDK - C# - Remove Text from PDF - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

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.

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 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(); } } }

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout PDF Extractor SDK Home Page

Explore ByteScout PDF Extractor SDK Documentation

Explore Samples

Sign Up for ByteScout PDF Extractor SDK 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 PDF Extractor SDK Home Page

Explore ByteScout PDF Extractor SDK Documentation

Explore Samples

Sign Up for ByteScout PDF Extractor SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next