All docs
V21.1
21.2 (EAP/Beta)
21.1
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+

PdfDocumentFacade.FlattenAnnotations(Func<PdfAnnotationFacade, Boolean>) Method

Flattens all annotations that meet the specified criteria.

Namespace: DevExpress.Pdf

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

Declaration

public void FlattenAnnotations(
    Func<PdfAnnotationFacade, bool> predicate
)

Parameters

Name Type Description
predicate Func<PdfAnnotationFacade, Boolean>

Defines a set of criteria for the PdfAnnotationFacade object.

Remarks

The code sample below flattens annotations that are located on the lower half of the page:

using (PdfDocumentProcessor processor = new PdfDocumentProcessor())
{
  //Load a document:
  processor.LoadDocument("..\\..\\Document.pdf");
  PdfDocumentFacade documentFacade = processor.DocumentFacade;

  double halfPage = processor.Document.Pages[0].CropBox.Top / 2;
  documentFacade.FlattenAnnotations(x => x.Rectangle.Top < halfPage);
  //Save the result:
  processor.SaveDocument("..\\..\\Result.pdf");
}
System.Diagnostics.Process.Start("..\\..\\Result.pdf");
See Also