Appearance
Mobile Document Scanner API Reference / DocumentCorrectionViewToolbarButtonsConfig
Interface: DocumentCorrectionViewToolbarButtonsConfig
Defined in: src/views/DocumentCorrectionView.ts:82
Configuration interface for customizing toolbar buttons in the DocumentCorrectionView.
Remarks
This interface allows you to customize the appearance and behavior of the toolbar buttons displayed in the DocumentCorrectionView. Each button can be configured using a ToolbarButtonConfig object to modify its icon, label, CSS class, or visibility.
The behaviors described for each button below are the default behaviors. You can override the default behavior by providing a custom ToolbarButton.onClick handler through the ToolbarButtonConfig.
Examples
Customize button appearance:
javascript
const documentScanner = new Dynamsoft.DocumentScanner({
license: "YOUR_LICENSE_KEY_HERE",
correctionViewConfig: {
toolbarButtonsConfig: {
fullImage: {
isHidden: true
},
detectBorders: {
icon: "path/to/new_icon.png",
label: "Custom Label"
}
}
}
});Override button behavior with custom onClick handler:
javascript
const documentScanner = new Dynamsoft.DocumentScanner({
license: "YOUR_LICENSE_KEY_HERE",
correctionViewConfig: {
toolbarButtonsConfig: {
apply: {
label: "Confirm",
onClick: async () => {
// Custom confirmation logic
await validateBoundaries();
console.log("Boundaries confirmed!");
}
}
}
}
});Properties
apply?
optionalapply?:Partial<Pick<ToolbarButton,"icon"|"label"|"className"|"isHidden">>
Defined in: src/views/DocumentCorrectionView.ts:109
Configuration for the apply button. Default behavior: applies the current boundary adjustments and proceeds with the workflow.
Remarks
In continuous scanning mode (DocumentScannerConfig.enableContinuousScanning) when DocumentResultView is disabled, this button is labeled "Keep Scan" by default and returns to the DocumentScannerView for the next scan. Otherwise, it is labeled "Apply" when DocumentResultView is shown, or labeled "Done" otherwise.
detectBorders?
optionaldetectBorders?:Partial<Pick<ToolbarButton,"icon"|"label"|"className"|"isHidden">>
Defined in: src/views/DocumentCorrectionView.ts:100
Configuration for the detect borders button. Default behavior: automatically detects document boundaries using the document detection algorithm.
fullImage?
optionalfullImage?:Partial<Pick<ToolbarButton,"icon"|"label"|"className"|"isHidden">>
Defined in: src/views/DocumentCorrectionView.ts:94
Configuration for the full image button. Default behavior: sets the document boundaries to match the full image dimensions.
retake?
optionalretake?:Partial<Pick<ToolbarButton,"icon"|"label"|"className"|"isHidden">>
Defined in: src/views/DocumentCorrectionView.ts:88
Configuration for the retake button. Default behavior: returns to the DocumentScannerView to capture a new image.