# Exporting a PDF in MAUI

When exporting PDF documents in MAUI, you have the option to customize the export process using the [`IExportConfiguration`](https://www.nutrient.io/api/maui/api/PSPDFKit.Api.IExportConfiguration.html) interface to meet your specific requirements.

## Introduction to export configurations

[`IExportConfiguration`](https://www.nutrient.io/api/maui/api/PSPDFKit.Api.IExportConfiguration.html) is an interface that represents the configuration with which a document will be exported. It offers several properties you can set to modify the export behavior. You can create an object of export configuration from the document using the [`<IDocument>.CreateExportConfiguration()`](https://www.nutrient.io/api/maui/api/PSPDFKit.Api.IDocument.html#PSPDFKit_Api_IDocument_CreateExportConfiguration) method. If you choose to pass `null` instead of an object to the export method, the default configuration will be applied automatically.

The following sections cover the key properties of the [`IExportConfiguration`](https://www.nutrient.io/api/maui/api/PSPDFKit.Api.IExportConfiguration.html) interface.

### ExcludeAnnotations (default: False)

The [`ExcludeAnnotations`](https://www.nutrient.io/api/maui/api/PSPDFKit.Api.IExportConfiguration.html#PSPDFKit_Api_IExportConfiguration_ExcludeAnnotations) property allows you to exclude annotations from an exported document. By setting it to `true`, you can create a document without any annotations:

```csharp

IExportConfiguration exportConfig = _document.CreateExportConfiguration();
exportConfig.ExcludeAnnotations = true;

```

### ExportForPrinting (default: False)

When set to `true`, the [`ExportForPrinting`](https://www.nutrient.io/api/maui/api/PSPDFKit.Api.IExportConfiguration.html#PSPDFKit_Api_IExportConfiguration_ExportForPrinting) property excludes annotations that have the `NoPrint` flag set from the exported document. This is useful when you want to create a print-ready document without certain annotations.

Note that currently, we can only set the `NoPrint` flag on annotations using advance API access:

```csharp

IExportConfiguration exportConfig = _document.CreateExportConfiguration();
exportConfig.ExportForPrinting = true;

```

### ExportIncrementally (default: False, but true for digitally signed documents)

When persisting changes to an open document, two main strategies are available: incremental saving and full saving.

Incremental saving consists of appending new changes to the end of a document while keeping the previous versions of it intact, which is useful when working with digitally signed documents, as digital signatures are invalidated if the integrity of a signed content is compromised.

Full saving, on the other hand, rewrites an entire document instead of appending changes at the end of it. This prevents the document file size from growing on every revision, but it’s slower than incremental saving.

Nutrient MAUI SDK uses full saving by default, except for with digitally signed documents, which use incremental saving by default if the Digital Signatures component is present in the license. If you wish to use incremental saving instead, set the [`ExportIncrementally`](https://www.nutrient.io/api/maui/api/PSPDFKit.Api.IExportConfiguration.html#PSPDFKit_Api_IExportConfiguration_ExportIncrementally) flag to `true` when calling the [`_document.ExportDocumentAsync`](https://www.nutrient.io/api/maui/api/PSPDFKit.Api.IDocument.html#PSPDFKit_Api_IDocument_ExportDocumentAsync_PSPDFKit_Api_IExportConfiguration_) method:

```csharp

IExportConfiguration exportConfig = _document.CreateExportConfiguration();
exportConfig.ExportIncrementally = true;

```

Setting `ExportIncrementally` when `Flatten` is already set will result in an `InvalidOperationException`.

### Flatten (default: False)

When set to `true`, this property visually embeds annotations and form fields in a document, making them non-editable in the future:

```csharp

IExportConfiguration exportConfig = _document.CreateExportConfiguration();
exportConfig.Flatten = true;

```

Setting `Flatten` when `ExportIncrementally` is already set will result in an `InvalidOperationException`.

### Permissions

The [`Permissions`](https://www.nutrient.io/api/maui/api/PSPDFKit.Api.IExportConfiguration.html#PSPDFKit_Api_IExportConfiguration_Permissions) property allows you to set the user and owner password on an exported document. This is particularly useful when you want to restrict access or actions on the document:

```csharp

IExportConfiguration exportConfig = _document.CreateExportConfiguration();
exportConfig.Permissions.UserPassword = "userPassword";
exportConfig.Permissions.OwnerPassword = "ownerPassword";
exportConfig.Permissions.PermissionFlags = AnnotationsAndForms | Assemble // set the permissions here;

```
---

## Related pages

- [Save a PDF document in MAUI](/guides/maui/save-a-document.md)
- [Save a PDF document to an array buffer in MAUI](/guides/maui/save-a-document/to-arraybuffer.md)
- [Save a PDF to local storage in MAUI](/guides/maui/save-a-document/to-local-storage.md)
- [Save a PDF to a remote server in MAUI](/guides/maui/save-a-document/to-remote-server.md)

