PDF Generation Template Editor
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
CPDFConfiguration.creationConfig controls the active tool and selection state after creating annotations or forms through the reader UI. It does not affect objects created through document APIs.
| Field | Type | Default | Description |
|---|---|---|---|
continuousCreation | boolean | true | Keeps the creation tool active; when false, returns to the mode's default tool after one object is created |
autoSelectCreatedAnnotation | boolean | true | Automatically selects the new annotation or form; when false, leaves it unselected |
The options are independent. For example, disable continuous creation and retain automatic selection to adjust an object's properties immediately after creating it.
Add these options to your configuration file and load it as described in Configuration Overview:
{
"creationConfig": {
"continuousCreation": false,
"autoSelectCreatedAnnotation": true
}
}Omitting creationConfig or either field uses the corresponding default value.
Set the options before creating CPDFDocumentFragment or starting the document Activity:
import com.compdfkit.tools.common.pdf.config.CreationConfig;
configuration.creationConfig = new CreationConfig();
configuration.creationConfig.continuousCreation = false;
configuration.creationConfig.autoSelectCreatedAnnotation = true;import com.compdfkit.tools.common.pdf.config.CreationConfig
configuration.creationConfig = CreationConfig().apply {
continuousCreation = false
autoSelectCreatedAnnotation = true
}To change the policy in the current reader, configure its internal CPDFReaderView on the main thread:
CPDFReaderView readerView = pdfView.getCPdfReaderView();
readerView.setContinuousCreation(false);
readerView.setAutoSelectCreatedAnnotation(true);val readerView = pdfView.getCPdfReaderView()
readerView.setContinuousCreation(false)
readerView.setAutoSelectCreatedAnnotation(true)Here, pdfView is the Tools reader view. These settings affect subsequent interactive creation; they do not reselect existing objects or change saved PDF content.
See Annotation Toolbar and Form Toolbar for tool integration.