Appearance
Mobile Document Scanner API Reference / DocumentResultViewToolbarButtonsConfig
Interface: DocumentResultViewToolbarButtonsConfig
Defined in: src/views/DocumentResultView.ts:71
Configuration interface for customizing toolbar buttons in the DocumentResultView.
Remarks
This interface allows you to customize the appearance and behavior of the toolbar buttons displayed in the DocumentResultView. 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",
resultViewConfig: {
toolbarButtonsConfig: {
retake: {
isHidden: true
},
share: {
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",
resultViewConfig: {
toolbarButtonsConfig: {
done: {
label: "Save",
onClick: async () => {
// Custom save logic
await saveToServer(documentScanner.result);
console.log("Document saved!");
}
},
share: {
onClick: async () => {
// Custom share logic
await sendViaEmail(documentScanner.result);
}
}
}
}
});Properties
correct?
optionalcorrect?:Partial<Pick<ToolbarButton,"icon"|"label"|"className"|"isHidden">>
Defined in: src/views/DocumentResultView.ts:83
Configuration for the correct button. Default behavior: enters the DocumentCorrectionView to adjust document boundaries.
done?
optionaldone?:Partial<Pick<ToolbarButton,"icon"|"label"|"className"|"isHidden">>
Defined in: src/views/DocumentResultView.ts:110
Configuration for the done button. Default behavior: completes the scanning workflow.
Remarks
In continuous scanning mode (DocumentScannerConfig.enableContinuousScanning), a separate floating "Scan More" button keeps the current scan and loops back to the DocumentScannerView for the next capture.
filter?
optionalfilter?:Partial<Pick<ToolbarButton,"icon"|"label"|"className"|"isHidden">>
Defined in: src/views/DocumentResultView.ts:129
Configuration for the filter button. Default behavior: reveal drop-up menu with the following filters:
- Original
- Grayscale
- Black & White
- Sepia
- Inverted
retake?
optionalretake?:Partial<Pick<ToolbarButton,"icon"|"label"|"className"|"isHidden">>
Defined in: src/views/DocumentResultView.ts:77
Configuration for the retake button. Default behavior: returns to the DocumentScannerView to capture a new image.
rotate?
optionalrotate?:Partial<Pick<ToolbarButton,"icon"|"label"|"className"|"isHidden">>
Defined in: src/views/DocumentResultView.ts:117
Configuration for the done button. Default behavior: rotate the image 90 degrees clockwise.
share?
optionalshare?:Partial<Pick<ToolbarButton,"icon"|"label"|"className"|"isHidden">>
Defined in: src/views/DocumentResultView.ts:92
Configuration for the share button. Default behavior: shares or downloads the scanned document.
Remarks
On mobile devices with Web Share API support, this button triggers the native share dialog. On desktop or devices without share support, it downloads the image instead.
upload?
optionalupload?:Partial<Pick<ToolbarButton,"icon"|"label"|"className"|"isHidden">>
Defined in: src/views/DocumentResultView.ts:101
Configuration for the upload button. Default behavior: triggers the DocumentResultViewConfig.onUpload callback.
Remarks
This button is only visible when DocumentResultViewConfig.onUpload is defined.