All docs
V21.2
21.2
21.1
The page you are viewing does not exist in version 21.1. This link will take you to the root page.
20.2
The page you are viewing does not exist in version 20.2. This link will take you to the root page.
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

PdfClearContentRegions Class

A collection of page regions to clear.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Pdf.v21.2.Core.dll

Declaration

public class PdfClearContentRegions

Remarks

Pass the PdfClearContentRegions object as the PdfPageFacade.ClearContent to clear multiple page regions.

The code sample below clears all found entries of a specific word:

using (PdfDocumentProcessor pdfDocumentProcessor = new PdfDocumentProcessor())
{
    pdfDocumentProcessor.LoadDocument("Document.pdf");
    PdfDocumentFacade documentFacade = pdfDocumentProcessor.DocumentFacade;
    PdfPageFacade pageFacade = documentFacade.Pages[0];

    //Find target phrase in the document
    string removeText = "Ounce";

    PdfTextSearchParameters searchParameters = new PdfTextSearchParameters() { WholeWords = true };
    PdfTextSearchResults searchResults = pdfDocumentProcessor.FindText(removeText, searchParameters);

    PdfClearContentRegions contentRegions = new PdfClearContentRegions();

    // Retrieve text rectangles
    while (searchResults.Status == PdfTextSearchStatus.Found && searchResults.PageNumber == 1)
    {
        contentRegions.Add(searchResults.Rectangles);
        searchResults = pdfDocumentProcessor.FindText(removeText, searchParameters);
    }

    // Remove found entries
    pageFacade.ClearContent(contentRegions, new PdfClearContentOptions());

    pdfDocumentProcessor.SaveDocument("Document_cleared.pdf");
}

Inheritance

Object
PdfClearContentRegions
See Also