This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/flutter/save-a-document/save-options.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Document save options in Flutter

Use DocumentSaveOptions to control how Nutrient Flutter SDK saves and exports documents. Pass it to save() or exportPdf() on the viewer’s controller.document, or on a document you opened headlessly with Nutrient.openDocument(). Refer to the document save options(opens in a new tab) API reference for details.

The following save options are available. Every field is optional. If you omit a field, the SDK uses its default value.

OptionApplies toDescription
userPasswordAllSets the user password (or open password) and encrypts the output PDF.
ownerPasswordAllSets the owner password (or permissions password) for the output PDF.
permissionsAllSets permitted operations on the encrypted document.
flattenAllBakes annotations and form fields into the page content.
incrementalAndroid, iOS, Web (standalone)Appends changes instead of rewriting the whole file.
excludeAnnotationsAllOmits annotations from the saved file.
saveForPrintingStandalonePrepares the output for printing.
pdfVersionAndroid, iOSSets the target PDF version, from pdf_1_0 to pdf_1_7. Web ignores this.
includeCommentsWeb (server-backed)Includes comments in the exported document.
outputFormatWeb, standaloneOverrides the output format, for example, 'pdf/a-2b' for PDF/A.
optimizeAndroid, Web (server-backed)Prepares the document for web delivery.

Refer to the document permissions(opens in a new tab) and PDF version(opens in a new tab) API references for supported permissions and pdfVersion values.

Save with options

Use DocumentSaveOptions with save() to save a document with custom options. You can also provide an outputPath to save to a different location. Refer to the save(opens in a new tab) API reference for details.

final document = await Nutrient.openDocument(documentPath);
// Save in place with options.
await document.save(
options: DocumentSaveOptions(
flatten: true,
incremental: false,
excludeAnnotations: false,
),
);
// Save to a different path.
await document.save(
outputPath: '/path/to/output.pdf',
options: DocumentSaveOptions(
flatten: true,
),
);

Export with options

Use DocumentSaveOptions with exportPdf() to export a document copy as binary data. Refer to the export PDF(opens in a new tab) API reference for details.

final data = await document.exportPdf(
options: DocumentSaveOptions(
userPassword: 'userPassword',
ownerPassword: 'ownerPassword',
flatten: true,
incremental: true,
excludeAnnotations: true,
saveForPrinting: true,
permissions: [
DocumentPermissions.printing,
DocumentPermissions.modification,
],
),
);
// Save the data to a file or upload to a remote server.

For more details about saving a document with Nutrient Flutter SDK, refer to the Catalog example project(opens in a new tab).