Flattening PDF Annotations in MAUI

When flattening an annotation, the annotation is removed from a document, while its visual representation is kept intact. A flattened annotation is still visible but no longer editable by your users or your app. This can be used, for example, to permanently apply annotations to your document, or to make annotations visible to viewers that otherwise can’t show annotations (like Safari on iOS).

You can use IExportConfiguration.Flatten to flatten annotations during export:

var exportConfiguration = _document.CreateExportConfiguration();
exportConfiguration.Flatten = true;
byte[] fileBytes = await _document.ExportDocumentAsync(exportConfiguration);