We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Syncfusion Feedback

Syncfusion is trusted by the world’s leading companies

Syncfusion Trusted Companies

Overview

The Syncfusion .NET PDF library provides an easy way to permanently remove confidential or sensitive information from PDF documents with just a few lines of code. This feature complies with privacy laws such as GDPR.

This feature works seamlessly across platforms, including Windows, macOS, Linux, Android, and iOS through any .NET-based applications, such as ASP.NET Core, ASP.NET MVC, Blazor, .NET MAUI, Xamarin, WinForms, WPF, and WinUI.

How to redact PDF content from PDF documents in C#

Remove the confidential content from the page in the PDF document with just a few lines of C# code, as demonstrated in the following code.

using Syncfusion.Pdf.Parsing;
using Syncfusion.Pdf.Redaction;
using Syncfusion.Pdf;
using Syncfusion.Drawing;

using (FileStream docStream = new FileStream(@"Input.pdf", FileMode.Open, FileAccess.Read))
{
    //Load the PDF document from the input stream
    using (PdfLoadedDocument loadedDocument = new PdfLoadedDocument(docStream))
    {
        // Get the first page of the loaded document
        PdfLoadedPage firstPage = loadedDocument.Pages[0] as PdfLoadedPage;
        // Create a PDF redaction for the specified rectangle on the page
        RectangleF redactionRectangle = new RectangleF(340, 120, 140, 20);
        PdfRedaction redaction = new PdfRedaction(redactionRectangle);
        // Add the redaction to the first page
        firstPage.AddRedaction(redaction);
        // Redact the contents from the PDF document
        loadedDocument.Redact();
        // Save the redacted PDF document to a file stream
        using (FileStream outputFileStream = new FileStream("Redact.pdf", FileMode.Create, FileAccess.ReadWrite))
        {
            loadedDocument.Save(outputFileStream);
        }
    }
}

Key Functions of Redact PDF

Discover how the Redact PDF feature removes content from PDF documents with various options.

Mark for redaction in .NET PDF.

Mark for redaction

Mark sensitive or confidential data programmatically and forward it to the next person for further review and approval before redacting.

Permanently remove sensitive data in .NET PDF.

Permanently remove sensitive data

Remove sensitive or confidential text, images, areas, or entire pages permanently from the PDF documents using the PDF redaction support.

Display text on redacted area in .NET PDF.

Redact sensitive content with an overlay text

Draw the overlay text on the redacted area and customize it with a different font, style, color, and brush.

Redact content with an image in .NET PDF.

Redact sensitive content with an overlay image

Redact the information from a page by drawing an image on the redacted area. This will completely remove the content from the PDF document and apply the image over the redacted area.

Explore references of Redact PDF

Discover valuable resources from our blog and knowledge base articles to enhance your efficiency in the Redact PDF feature.

Double-Check Content Using Redaction Annotation in PDFs with C#

Blog

Double-Check Content Using Redaction Annotation in PDFs with C#

Easy Ways to Redact PDFs Using C

Blog

Easy Ways to Redact PDFs Using C#

Find text and mark with the redaction annotation in NET PDF

Blog

Find text and mark it with the redaction annotation

Syncfusion .NET PDF Library Resources

Explore these resources for comprehensive guides, knowledge base articles, insightful blogs, and ebooks.

Struggling to decide on the right product?

Our comprehensive competitor comparison of PDF framework will guide you to the perfect choice.

tick-mark 20+ Conversions support
tick-mark 50+ interactive demos
tick-mark 1.7M+ downloads
competitive-banner-FT-image

Frequently Asked Questions

Redaction is the process of permanently removing or obscuring sensitive or confidential information from a document. This is typically done to protect sensitive data from unauthorized access or disclosure.

Yes, the redaction feature permanently removes the content from the PDF document.

Yes, you can redact images in a PDF document using the Syncfusion .NET PDF library.

You might need to redact a PDF document to safeguard personal information, comply with privacy regulations, protect classified data, or ensure confidentiality in legal or business documents.

No, you can’t recover the redacted content from the PDF document because it is deleted permanently.

Our Customers Love Us

Having an excellent set of tools and a great support team, Syncfusion reduces customers’ development time.
Here are some of their experiences.

Rated by users across the globe

Want to create, view, and edit PDF files in C# or VB.NET?

Start a free 30-day evaluation today!
DOWNLOAD FREE TRIAL

No credit card required.

Mobile Free Evaluation Section

Awards

Greatness—it’s one thing to say you have it, but it means more when others recognize it. Syncfusion is proud to hold the following industry awards.

Scroll up icon