Back to Devexpress

PdfDocumentFacade.FlattenAnnotations(PdfAnnotationType[]) Method

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

latest2.1 KB
Original Source

PdfDocumentFacade.FlattenAnnotations(PdfAnnotationType[]) Method

Flattens all document 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.

|

Example

The code sample below flattens all text annotations in the document:

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

  // Flatten all text annotations:
  PdfDocumentFacade documentFacade = processor.DocumentFacade;
  documentFacade.FlattenAnnotations(PdfAnnotationType.Text);

  // Save the result:
  processor.SaveDocument("..\\..\\Result.pdf");
}
vb
Using processor As New PdfDocumentProcessor()
  ' Load a document:
  processor.LoadDocument("..\..\Document.pdf")

  ' Flatten all text annotations:
  Dim documentFacade As PdfDocumentFacade = processor.DocumentFacade
  documentFacade.FlattenAnnotations(PdfAnnotationType.Text)

  ' Save the result:
  processor.SaveDocument("..\..\Result.pdf")
End Using

See Also

PdfDocumentFacade Class

PdfDocumentFacade Members

DevExpress.Pdf Namespace