Closed dylanvdmerwe closed 6 years ago
I hope this clears up some of the confusion. The accuracy/performance button does not make a big difference as far as I could tell. Work on both android and ios libraries to optimize and improve overall performance will be our main focus once work on the plugin starts up again.
Thank you for bringing these issues to our attention. Unfortunately I can't help you too much with enhancements in the short term, but all of these will be addressed at one point.
Can we customize to have the manual scan as default?
I've been looking to customize this too (and the other buttons) but I can't find where any of this is defined. Searches through the repo for "Manual" and "Auto" turn up nothing even though that text must be somewhere. If you can give me any hints @ChrisTomAlx I might be able to PR my changes to make this more customizable for other users too.
TL:DR
Make changes in the library, Build the library using carthage, add the framework build files to the plugin within the ios folder as seen in this repo. If there are changes that affect user input, i.e. user customization, then change the scan.js file to accept these inputs either as an object (better but requires android changes, currently android accepts array) or as an array.
Please read the long version below, it has more info I haven't mentioned above.
First of all thank you for offering to raise a PR :)
The document scanner plugin uses IRLDocumentScanner library found here.
Some customization can be achieved directly by changing the relevant lines in the scan.m
file as shown below. It even allows changing the overlay color when auto scan occurs (which is not mentioned here). More customisations (does not include auto - manual scan) that are readily allowed by the library and hence does not require rebuilding the library, can be found here.
// Creates scanner with default scanner view type and performance type
IRLScannerViewController *scanner = [IRLScannerViewController
cameraViewWithDefaultType:IRLScannerViewTypeNormal
defaultDetectorType:IRLScannerDetectorTypePerformance withDelegate:self];
scanner.showControls = YES;
scanner.showAutoFocusWhiteRectangle = YES;
[IRLScannerViewController attemptRotationToDeviceOrientation];
Making these changes, also means we will have to find similar changes in the android library (Or choose not to do anything in android when these customization are requested). Either way the scan.js
file which currently looks like below will have to be changed:
module.exports = {
scanDoc: function (sourceType, successCallback, errorCallback) {
cordova.exec(successCallback, errorCallback, "Scan", "scanDoc", [sourceType]);
}
};
This will need to be changed to either support taking an object (Better code, but slightly harder to implement) as the input or take more inputs in the current array, as shown below 1) object
// eg optionObject
// {
// sourceType : 0;
// detectorView: IRLScannerDetectorTypePerformance; // type enum in obj C
// scanView: IRLScannerViewTypeNormal; // type enum in obj C
// overlayColor: #FFFFFF; // type color in obj C
// }
module.exports = {
scanDoc: function (optionObject, successCallback, errorCallback) {
cordova.exec(successCallback, errorCallback, "Scan", "scanDoc", optionObject);
}
};
2) array
module.exports = {
scanDoc: function (sourceType, detectorView, scanView, successCallback, errorCallback) {
cordova.exec(successCallback, errorCallback, "Scan", "scanDoc", [sourceType, detectorView, scanView]);
}
};
Note :- The passing as object into
scan.js
for scalability and the addition of already available customisations as user inputs are enhancements that will soon (can't promise a date as of yet) be addressed by us.There are two other libraries ( WeScan & Yes We Scan) I am looking at, which seem to be better maintained. Thinking about a total revamp using either of these, they support extra customization as well. You can look at these too if you are interested. Or if you have come across another library which does the job better, please bring it to my attention.
Hello Chris,
I didn't see an option as to where you can default the plugin for IOS to be manual instead of automatic. Can you direct me to the setting that would achieve this?
Thanks, Tim
Where can we find documentation as to what the various buttons do on iOS. They are not very intuitive and users are very confused (and so I am) about what they all do.