Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f1a5154
Windows: initial Version
convey-gilbert Sep 18, 2019
1ec232d
Windows: argscheck
convey-gilbert Sep 18, 2019
cb34aa5
Windows: argscheck typo
convey-gilbert Sep 18, 2019
2aa4558
Windows: added file result feature if !returnBase64
convey-gilbert Sep 18, 2019
36dfcbf
Windows: some style improvements for camera UI
convey-gilbert Sep 19, 2019
bcfabcc
Windows: initial version including Windows 8.1
convey-gilbert Sep 19, 2019
5d63490
Windows: some bugfixes at versionInfo and property uuids after merge …
convey-gilbert Sep 19, 2019
6c02c05
Windows 10: minor optimization at points detection
convey-gilbert Sep 19, 2019
0963c59
Windows: functional version for Windows 8.1 with Media Transform Filter
convey-gilbert Sep 24, 2019
0e22fcc
Android: decreased version limit
convey-gilbert Sep 25, 2019
6415139
Android: changed build.gradle for backward compatibility
convey-gilbert Sep 25, 2019
891334d
Windows: added use of LowLagPhotoCapture API if available on device
convey-gilbert Sep 26, 2019
e05580d
Windows: strokeWidth of canvas overlay incerased
convey-gilbert Sep 26, 2019
e5f9610
Windows: finished rotationDegree parameter support
convey-gilbert Sep 26, 2019
f6208ce
iOS: Bugfix for iOS13+ to display scanner UIView in fullscreen
convey-gilbert Oct 2, 2019
b777e6f
Windows: added missing props file for Windows Phone 8.1 target
convey-gilbert Oct 4, 2019
b71459b
Windows 8.1: Fixed exception on Win8.1 due to accidentally deleted fo…
convey-gilbert Oct 5, 2019
bd2b3b1
Update README.md
convey-gilbert Oct 7, 2019
28d3d73
Windows: support of Win8.1 App on Win10 device
convey-gilbert Oct 10, 2019
3fff58c
Fix: check mocule version instead OS version
convey-gilbert Oct 16, 2019
41b08c3
Windows 10: less flickering of edges on devices with faster cpu
convey-gilbert Oct 22, 2019
1497e96
Windows 10: minor improvement on auto shutter
convey-gilbert Oct 23, 2019
01345b8
Windows: deleted accidentally re-inserted version check again
convey-gilbert Nov 4, 2019
9d9d1a2
Windows 8.1: OpenCV DLL deploy added
convey-gilbert Nov 4, 2019
b9151ff
Windows: optimized recognition smoothing
convey-gilbert Nov 5, 2019
e647b69
Update documentScannerProxy.js
convey-gilbert Nov 5, 2019
2e5b535
Windows 10: Convert to grayscale added
convey-gilbert Nov 18, 2019
5f53cad
scanlibrary 3.3 version update
hung91 Oct 4, 2022
b7f8ef7
version reverted to 2.51 (scanlibrary)
hung91 Oct 4, 2022
3b2dabe
remove define ordova-plugin-document-scanner.scan
hung91 Oct 4, 2022
f80e7b2
test - ignore undefined options
hung91 Oct 4, 2022
50e81f7
revert changes rotationDegree, brightnessValue, focusValue, contrastV…
hung91 Oct 4, 2022
bb56104
Windows: Added front camera selection
convey-gilbert Jan 2, 2025
0de285c
Windows: Added sourceType 2 Front Camera. Bugfix photo capture
convey-gilbert Jan 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ function onDeviceReady() {
- Android

- iOS

- Windows Phone 8.1, Windows RT 8.1, Windows 8.1, Windows 10 Mobile, Windows 10

# Installation

Expand Down Expand Up @@ -132,6 +134,14 @@ Take a photo and retrieve the image's file location. Options need not be passed

- Android example imageURI returned :- file:///storage/emulated/0/Pictures/1563790575755.jpg

# Windows Quirks

- Windows has only document scan via camera for now (Any argument passed will start the camera scan). Document Scan from gallery will be available in future version. Also scanned images aren't saved to the photos library in Windows.

- If you don't use use returnBase64, please don't forget to delete the file before next call to scanDoc with the same file name. If a previous file already exists, a new unique fileName is used.

- An example file URI obtained from success call back of scanDoc function in an app with given APP_PACKAGE_NAME installed by a user with USER_NAME looks like this C:\\Users\\USER_NAME\\AppData\\Local\\Packages\\APP_PACKAGE_NAME\\TempState\\photo.jpg

# Issues and Fixes

<details>
Expand Down Expand Up @@ -184,6 +194,9 @@ Android :- [AndroidScanner](https://github.com/jhansireddy/AndroidScannerDemo) <
iOS [4.x.x] :- [IRLDocumentScanner](https://github.com/charlymr/IRLDocumentScanner) <br/>

iOS [3.x.x] :- [WeScan](https://github.com/WeTransfer/WeScan)

Windows :- https://opencv.org/opencv-3-1/ <br/> Be aware of that the binary DLLs provided there aren't suitable for Store App deployment. You need to download the source code and build your own binary DLLs with the needed complier and linker flags. The binary DLLs included in this plugin can be used for Store App deployment. <br/>


Huge thanks to these authors for making their document scanning native libraries public.

Expand Down
30 changes: 29 additions & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0" id="cordova-plugin-document-scanner" version="4.2.1">

<name>Scan</name>
<description>Cordova Document Scanner Plugin</description>
<keywords>cordova,camera,document,scan</keywords>
<engines>
<engine name="cordova-android" version=">=6.4.0" />
<engine name="cordova-android" version=">=6.0.0" />
</engines>
<asset src="www/scan.js" target="js/scan.js"/>
<js-module src="www/scan.js" name="scan">
Expand Down Expand Up @@ -47,4 +49,30 @@
<framework src="src/ios/IRLDocumentScanner.framework" custom="true" embed="true"/>
</platform>

<platform name="windows">
<js-module src="src/windows/documentScannerProxy.js" name="DocumentScannerProxy">
<merges target=""/>
</js-module>
<config-file target="package.appxmanifest" parent="/Package/Capabilities">
<DeviceCapability Name="webcam"/>
</config-file>
<config-file target="package.appxmanifest" parent="/Package/Extensions" versions="8.1">
<Extension Category="windows.activatableClass.inProcessServer">
<InProcessServer>
<Path>ClippingCamera.dll</Path>
<ActivatableClass ActivatableClassId="ClippingCamera.ImageClipping" ThreadingModel="both" />
</InProcessServer>
</Extension>
</config-file>
<config-file target="CordovaApp.jsproj" parent="/Project" versions="8.1">
<ImportGroup Label="PropertySheets">
<Import Project="..\..\plugins\cordova-plugin-document-scanner\src\windows\filter\ClippingCamera\opencvDeploy.props" />
</ImportGroup>
</config-file>
<framework src="src/windows/filter/ClippingCamera/ClippingCamera.vcxproj" custom="true" type="projectReference" target="windows" versions="8.1"/>
<framework src="src/windows/filter/ClippingCamera/ClippingCamera.Phone.vcxproj" custom="true" type="projectReference" target="phone" versions="8.1"/>
<framework src="src/windows/lib/OpenCVBridge/OpenCVBridge.vcxproj" custom="true" type="projectReference" versions="10.*"/>
<asset src="src/windows/assets/plugin-document-scanner.css" target="css/plugin-document-scanner.css"/>
</platform>

</plugin>
6 changes: 6 additions & 0 deletions src/android/Scan.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo
this.callbackContext.error("Illegal Argument Exception");
PluginResult r = new PluginResult(PluginResult.Status.ERROR);
this.callbackContext.sendPluginResult(r);
} catch (Exception e) {
this.callbackContext.error("Something went wrong! Try reducing the quality option.");
PluginResult r = new PluginResult(PluginResult.Status.ERROR);
this.callbackContext.sendPluginResult(r);
}

return true;
Expand All @@ -99,6 +103,8 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {
} else {
this.callbackContext.error("null data from scan libary");
}
} else {
this.callbackContext.error("Incorrect result or user canceled the action.");
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ allprojects {
}

dependencies {
implementation 'com.github.NeutrinosPlatform:scanlibrary:2.3'
compile 'com.github.NeutrinosPlatform:scanlibrary:2.51'
}
Binary file modified src/ios/IRLDocumentScanner.framework/.DS_Store
Binary file not shown.
Binary file modified src/ios/IRLDocumentScanner.framework/Assets.car
Binary file not shown.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// IRLScanner.h
// Pods
//
// Created by Denis Martin on 12/07/2015.
//
// This code is based on the following project by Maximilian Mackh
// Based on https://github.com/mmackh/IPDFCameraViewController
//

#import <UIKit/UIKit.h>

//! Project version number for IRLDocumentScanner.
FOUNDATION_EXPORT double IRLDocumentScannerVersionNumber;

//! Project version string for IRLDocumentScanner.
FOUNDATION_EXPORT const unsigned char IRLDocumentScannerVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <IRLDocumentScanner/PublicHeader.h>

@import TOCropViewController;
#import "IRLDocumentScanner.h"

Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ typedef NS_ENUM(NSInteger,IRLScannerViewType)
{
/** No filtering */
IRLScannerViewTypeNormal,

/** Use a black/white filtered camera */
IRLScannerViewTypeBlackAndWhite,

/** Use a black/white Ultra contrasted camera */
IRLScannerViewTypeUltraContrast
};
Expand All @@ -35,7 +35,7 @@ typedef NS_ENUM(NSInteger,IRLScannerDetectorType)
{
/** Use more Accurate detection */
IRLScannerDetectorTypeAccuracy,

/** Use Fast detection */
IRLScannerDetectorTypePerformance
};
Expand All @@ -50,9 +50,9 @@ typedef NS_ENUM(NSInteger,IRLScannerDetectorType)

/**
@brief When the camera has finish the full detection for the scan, it will call this method.

@warning You must implement this method

@param image The scanned image
@param cameraView The instance of the IRLScannerViewController controller which has perform this scan
*/
Expand All @@ -62,27 +62,27 @@ typedef NS_ENUM(NSInteger,IRLScannerDetectorType)

/**
@brief This optional method let you decide what you want to write in the Title bar. It can be use in cases where you want to tell whihc filter the user is using. You can inspect the controller to have more details.

@warning This method will be call multiple time as long we don't have full confidence of our scan. When the camera is confident enough, you will not be able to change the text anymore.

@param cameraView The instance of the IRLScannerViewController controller which has perform this scan

@return The text you want to display
*/
-(NSString* _Nullable)cameraViewWillUpdateTitleLabel:(IRLScannerViewController* _Nonnull)cameraView;

/**
@brief The user has pushed the Cancel button.

@warning You are responsible fo removing the view. The scanner will only stop the scan

@param cameraView The instance of the IRLScannerViewController controller which has perform this scan
*/
-(void)didCancelIRLScannerViewController:(IRLScannerViewController* _Nonnull)cameraView;

/**
@brief <Deprecated> The user has pushed the Cancel button.

@param cameraView The instance of the IRLScannerViewController controller which has perform this scan
*/
-(void)cameraViewCancelRequested:(IRLScannerViewController* _Nonnull)cameraView __deprecated_msg("Use [IRLScannerViewControllerDelegate didCancelIRLScannerViewController:] ");
Expand All @@ -102,20 +102,20 @@ NS_CLASS_AVAILABLE(NA, 8_0)

/**
@brief This method instanciate our controller with the default value for cameraViewType: IRLScannerViewTypeBlackAndWhite and detectorType: IRLScannerDetectorTypeAccuracy .

@param delegate The Delegate conforming to the protocol IRLScannerViewControllerDelegate

@return A View controller you can use to scan your image.
*/
+ (instancetype _Nonnull)standardCameraViewWithDelegate:(id<IRLScannerViewControllerDelegate> _Nonnull)delegate;

/**
@brief This method instanciate our controller

@param type The type the camera will use to scan, see: IRLScannerViewType
@param detector The detector type the camera will use to detect our borders, see: IRLScannerDetectorType
@param delegate The Delegate conforming to the protocol IRLScannerViewControllerDelegate

@return A View controller you can use to scan your image.
*/
+ (instancetype _Nonnull)cameraViewWithDefaultType:(IRLScannerViewType)type
Expand All @@ -124,99 +124,99 @@ NS_CLASS_AVAILABLE(NA, 8_0)

/**
@brief You can set the overlay color of the detected document here.

@warning Default is [UIColor redColor]

@return The color we want to use when we are detecting our page.
*/
@property (readwrite, nonatomic) UIColor* _Nonnull detectionOverlayColor;


/**
@brief Depending what you want, there is some build-in filter that can be apply to the image.

@see IRLScannerViewType for more details

@return The current filtering type: IRLScannerViewType applied to the image on the camera.
*/
@property (readonly, nonatomic) IRLScannerViewType cameraViewType;

/**
@brief Depending what you want, you can have either Fast or Accurate detection of borders

@see IRLScannerDetectorType for more details

@return The current detection sensitivity: IRLScannerDetectorType use by the detector.
*/
@property (readonly, nonatomic) IRLScannerDetectorType detectorType;

/**
@brief This Boolan will show/hide the controlls of the camera. The controlls includ flash_toggle (If available), contrast_type, detect_toggle

@warning Default value is YES

@return Wherever the Camera View will show or not the controlls.
*/
@property (readwrite, nonatomic) BOOL showControls;

/**
@brief The controller can show a flashing white rectangle when the Auto Focus is trigger. It is automatically trigger when we reach about 50% of confidence for the detection and we are focusing on the center of the document.

@warning Default value is NO

@return Wherever the Camera View will show or not a flashing white rectangle.
*/
@property (readwrite, nonatomic) BOOL showAutoFocusWhiteRectangle;


/**
@brief This Button is for the flash of the camera

@discussion We provide an access to that button for you topersonalize its aspect.
We are using the following images (Defaut-OFF: "856-lightning-bolt", Selected-ON: "856-lightning-bolt-selected")

@return The button for our Flash Toggle.
*/
@property (weak, nonatomic, readonly) IBOutlet UIButton* _Nullable flash_toggle;

/**
@brief This Button is for the contrast/ Image filter use by the camera.

@discussion We provide an access to that button for you to personalize its aspect.
We are using the following images (Defaut-Normal: "822-photo-2", Selected-BlackAndWhite: "856-lightning-bolt-selected", Highlited-UltraContrast: "810-document-2-selected")

@see IRLScannerViewType cameraViewType

@return The button for our Constrast Filter Toggle.
*/
@property (weak, nonatomic, readonly) IBOutlet UIButton* _Nullable contrast_type;

/**
@brief This Button is for the Detection use by the camera to detect our borders.

@discussion We provide an access to that button for you topersonalize its aspect.
We are using the following images (Defaut-Accuracy: "873-magic-wand", Selected-Performance: "795-gauge-selected")

@see IRLScannerDetectorType detectorType

@return The button for our Detector Filter Toggle.
*/
@property (weak, nonatomic, readonly) IBOutlet UIButton* _Nullable detect_toggle;

/**
@brief This Button is here for the user to press in case if want to cancel the aciton.

@discussion We provide an access to that button for you topersonalize its aspect.

@return The button for our Cancel.
*/
@property (weak, nonatomic, readonly) IBOutlet UIButton* _Nullable cancel_button;

/**
@brief This Button is here for the user to press in case if want to cancel the aciton.

@discussion This button is here to provide compatibilty with Seth previous commit.

@return The button for our Cancel.
*/
@property (weak, nonatomic, readonly) IBOutlet UIButton* _Nullable cancel_scanning;
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified src/ios/IRLDocumentScanner.framework/IRLDocumentScanner
Binary file not shown.
Binary file modified src/ios/IRLDocumentScanner.framework/Info.plist
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
framework module IRLDocumentScanner {
umbrella header "IRLDocumentScanner-umbrella.h"
umbrella header "IRLDocumentScannerFramework.h"

export *
module * { export * }
Expand Down

This file was deleted.

Loading