Back to Devexpress

PdfPageFacade.FlattenAnnotations(PdfAnnotationType[]) Method

officefileapi-devexpress-dot-pdf-dot-pdfpagefacade-dot-flattenannotations-x28-devexpress-dot-pdf-dot-pdfannotationtype-x29.md

latest2.3 KB
Original Source

PdfPageFacade.FlattenAnnotations(PdfAnnotationType[]) Method

Flattens all page annotations with the specified types.

Namespace : DevExpress.Pdf

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

NuGet Package : DevExpress.Pdf.Core

Declaration

csharp
public void FlattenAnnotations(
    params PdfAnnotationType[] types
)
vb
Public Sub FlattenAnnotations(
    ParamArray types As PdfAnnotationType()
)

Parameters

NameTypeDescription
typesPdfAnnotationType[]

An array of annotation types.

|

Remarks

The code sample below flattens all text annotations on the first page:

csharp
using (PdfDocumentProcessor processor = new PdfDocumentProcessor())
{
  // Load a document
  processor.LoadDocument("..\\..\\Document.pdf");
  PdfDocumentFacade documentFacade = processor.DocumentFacade;
  PdfPageFacade pageFacade = documentFacade.Pages[0];

  // Flatten all text annotations
  pageFacade.FlattenAnnotations(PdfAnnotationType.Text);

  // Save the result
  processor.SaveDocument("..\\..\\Result.pdf");
}
System.Diagnostics.Process.Start("..\\..\\Result.pdf");
vb
Using processor As New PdfDocumentProcessor()
  ' Load a document
  processor.LoadDocument("..\..\Document.pdf")
  Dim documentFacade As PdfDocumentFacade = processor.DocumentFacade
  Dim pageFacade As PdfPageFacade = documentFacade.Pages[0]

  ' Flatten all text annotations
  pageFacade.FlattenAnnotations(PdfAnnotationType.Text);

  ' Save the result
  processor.SaveDocument("..\..\Result.pdf")
End Using
System.Diagnostics.Process.Start("..\..\Result.pdf")

See Also

PdfPageFacade Class

PdfPageFacade Members

DevExpress.Pdf Namespace