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

Nutrient Flutter SDK enables you to create a new document with embedded annotations using the static Nutrient.processAnnotations()(opens in a new tab) operation.

Parameters

Use these parameters to define which annotations Nutrient processes and where it stores the output file:

  • type specifies which AnnotationType(opens in a new tab) Nutrient should process. For the complete list, refer to the supported annotation types guide. To process all annotations, including forms, use AnnotationType.all.
  • mode is the AnnotationProcessingMode(opens in a new tab) that specifies how Nutrient should include annotations in the resulting document. To embed annotations while users can still modify them, use AnnotationProcessingMode.embed. For the other available processing modes, refer to the annotation flattening guide.
  • sourcePath is the path of the document to process.
  • destinationPath specifies where Nutrient stores the processed file.

Save all annotations before processing the document. For more details, refer to the guide on manually saving.

Usage

The following example embeds all annotations into the PDF and saves the output to PDFs/export.pdf:

await Nutrient.processAnnotations(
sourcePath: 'PDFs/document.pdf',
type: AnnotationType.all,
mode: AnnotationProcessingMode.embed,
destinationPath: 'PDFs/export.pdf',
);