Scan Tips
The SDK provides an optional toolbar item within the scanning screen, that when clicked, will open some tips on how to get the best scan result. By default it is activated for photo payment and disabled for document scan and shows some default items. You can customize it according to your needs or disable it completely.

Disable
To disable the scan tips, set the scanTips option to null.
For Document Scan, the scan tips are disabled by default.
- Photo Payment Promisify
- Callback
const result = await DocutainSDKPromisify.startPhotoPayment({
scanTips: null,
});
DocutainSDK.startPhotoPayment({
scanTips: null,
}, onSuccess, onError);
Enable
For Document Scan, the scan tips are disabled by default. To enable them with the default items, pass an empty scanTips object:
- Document Scan Promisify
- Callback
const result = await DocutainSDKPromisify.scanDocument({
scanTips: {},
});
DocutainSDK.scanDocument({
scanTips: {},
}, onSuccess, onError);
Customize
If you want to provide your own items instead of the default items, you can do that by providing your own list of DocutainListItem.
Each item consists of an image, a title and a message.
image needs to be a name of an image resource in the drawable folder (Android), respectively the name of an image in your assets catalog (iOS).
- Document Scan Promisify
- Callback
- Photo Payment Promisify
- Callback
const scanTipsDefaultItems = await DocutainSDKPromisify.scanTipsDefaultItems();
const result = await DocutainSDKPromisify.scanDocument({
scanTips: {
items: [
scanTipsDefaultItems[1],
scanTipsDefaultItems[3],
{
image: 'my_icon',
title: 'my scanTips page 3',
message: 'my scantips as page 3\npage 1 is default page 2\npage 2 is default page 4',
},
]
}
});
DocutainSDK.scanTipsDefaultItems(function (scanTipsDefaultItems) {
DocutainSDK.scanDocument({
scanTips: {
items: [
scanTipsDefaultItems[1],
scanTipsDefaultItems[3],
{
image: 'my_icon',
title: 'my scanTips page 3',
message: 'my scantips as page 3\npage 1 is default page 2\npage 2 is default page 4',
},
],
},
}, onSuccess, onError);
}, onError);
// default items specific to Photo Payment, e.g. including GiroCode
const scanTipsDefaultItems = await DocutainSDKPromisify.scanTipsDefaultItemsPhotoPayment();
const result = await DocutainSDKPromisify.startPhotoPayment({
scanTips: {
items: [
scanTipsDefaultItems[1],
scanTipsDefaultItems[3],
{
image: 'my_icon',
title: 'my scanTips page 3',
message: 'my scantips as page 3\npage 1 is default page 2\npage 2 is default page 4',
},
],
},
});
// default items specific to Photo Payment, e.g. including GiroCode
DocutainSDK.scanTipsDefaultItemsPhotoPayment(function (scanTipsDefaultItems) {
DocutainSDK.startPhotoPayment({
scanTips: {
items: [
scanTipsDefaultItems[1],
scanTipsDefaultItems[3],
{
image: 'my_icon',
title: 'my scanTips page 3',
message: 'my scantips as page 3\npage 1 is default page 2\npage 2 is default page 4',
},
],
},
}, onSuccess, onError);
}, onError);
The following provides an overview of the currently available options to alter the scanTips:
| Property | Type | Description |
|---|---|---|
items | DocutainListItem[] | The items you want to show within the scan tips. If you don't provide any items, some default items will be displayed. |
toolbarItem | DocutainButton | The toolbar item that will be shown allowing the user to open the scan tips. |
The title of the scan tips page can be changed via textTitleScanTipsPage of the TextConfiguration.
You can get the default items used by the SDK to use them for your own list.
- Cordova Promisify
- Cordova Callback
// default items for document scan
const defaultItems = await DocutainSDKPromisify.scanTipsDefaultItems();
// default items for Photo Payment, including additional items, e.g. GiroCode
const defaultItemsPhotoPayment = await DocutainSDKPromisify.scanTipsDefaultItemsPhotoPayment();
// default items for document scan
DocutainSDK.scanTipsDefaultItems(function (defaultItems) {
// use defaultItems
}, onError);
// default items for Photo Payment, including additional items, e.g. GiroCode
DocutainSDK.scanTipsDefaultItemsPhotoPayment(function (defaultItems) {
// use defaultItems
}, onError);
The following sample alters the toolbarItem icon.
icon needs to be a name of an image resource in the drawable folder (Android), respectively the name of an image in your assets catalog (iOS).
- Document Scan Promisify
- Callback
- Photo Payment Promisify
- Callback
const scanTipsDefaultItems = await DocutainSDKPromisify.scanTipsDefaultItems();
const result = await DocutainSDKPromisify.scanDocument({
scanTips: {
items: scanTipsDefaultItems,
toolbarItem: { icon: 'my_icon' },
},
});
DocutainSDK.scanDocument({
scanTips: {
toolbarItem: { icon: 'my_icon' },
},
}, onSuccess, onError);
const result = await DocutainSDKPromisify.startPhotoPayment({
scanTips: {
toolbarItem: { icon: 'my_icon' },
},
});
DocutainSDK.startPhotoPayment({
scanTips: {
toolbarItem: { icon: 'my_icon' },
},
}, onSuccess, onError);