officefileapi-devexpress-dot-pdf-dot-pdfpagefacade-dot-flattenannotations-x28-devexpress-dot-pdf-dot-pdfannotationtype-x29.md
Flattens all page annotations with the specified types.
Namespace : DevExpress.Pdf
Assembly : DevExpress.Pdf.v25.2.Core.dll
NuGet Package : DevExpress.Pdf.Core
public void FlattenAnnotations(
params PdfAnnotationType[] types
)
Public Sub FlattenAnnotations(
ParamArray types As PdfAnnotationType()
)
| Name | Type | Description |
|---|---|---|
| types | PdfAnnotationType[] |
An array of annotation types.
|
The code sample below flattens all text annotations on the first page:
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");
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