Skip to content
DemoFAQ

PDF Generation Template Editor

Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.

View on GitHub
Flutter Guides Creation policy

Annotation and Form Creation Policy ​

Starting with 3.2.0, ComPDF Flutter SDK supports CPDFCreationConfig to configure what happens after interactive creation.

dart
import 'package:compdfkit_flutter/configuration/cpdf_configuration.dart';

Set a Creation Policy ​

Pass the policy through CPDFConfiguration.creationConfig when creating a reader:

dart
final configuration = CPDFConfiguration(
  creationConfig: const CPDFCreationConfig(
    continuousCreation: false,
    autoSelectCreatedAnnotation: true,
  ),
);

Pass configuration to the configuration parameter of CPDFReaderWidget. This example exits the active creation tool after one object is created and selects the new object.

ParameterDefaultDescription
continuousCreationtrueKeep the current tool active to create more objects of the same type
autoSelectCreatedAnnotationtrueAutomatically select a newly created annotation or form field

For continuous drawing without selecting new objects, set these parameters to true and false, respectively.

Scope ​

This policy applies to the reader's interactive annotation and form tools, including tools selected through the controller. It does not change programmatic creation through CPDFDocument.addAnnotations() or addWidgets().

The policy is configured separately from Custom Annotation Creation Workflows. Custom UI must still complete or cancel creation as required by the callback; continuousCreation does not replace that workflow.

See Create Annotations and Create Form Fields.