Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
874 changes: 0 additions & 874 deletions .yarn/releases/yarn-3.6.4.cjs

This file was deleted.

944 changes: 944 additions & 0 deletions .yarn/releases/yarn-4.16.0.cjs

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
approvedGitRepositories:
- "**"

compressionLevel: mixed

enableGlobalCache: false

enableScripts: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.6.4.cjs
npmMinimalAgeGate: 0

yarnPath: .yarn/releases/yarn-4.16.0.cjs
10 changes: 5 additions & 5 deletions Libraries.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Open Source libraries used in the Scanbot SDK for React Native version 8.0.0
Open Source libraries used in the Scanbot SDK for React Native version 9.0.0
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Open Source libraries used in the Scanbot SDK for Android version 8.0.1
Open Source libraries used in the Scanbot SDK for Android version 9.0.0

CWAC-Camera

Expand Down Expand Up @@ -3487,7 +3487,7 @@ Version 1.1.0

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Open Source libraries used in ScanbotSDK for iOS version 8.0.4:
Open Source libraries used in ScanbotSDK for iOS version 9.0.0:

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Expand Down Expand Up @@ -5273,12 +5273,12 @@ defined by AIM ITS/04-023 International Technical Standard - Extended Channel In

magic-enum

Version v0.8.1
Version v0.9.7
(https://github.com/Neargye/magic_enum)

MIT License

Copyright (c) 2019 - 2022 Daniil Goncharov
Copyright (c) 2019 - 2024 Daniil Goncharov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ Besides React Native, the Scanbot Document Scanner SDK is also available on:
* [Cordova & Ionic](https://github.com/doo/scanbot-sdk-example-ionic)
* [.NET MAUI](https://github.com/doo/scanbot-sdk-maui-example)
* [JavaScript](https://github.com/doo/scanbot-sdk-example-web)
* [Xamarin](https://github.com/doo/scanbot-sdk-example-xamarin) & [Xamarin.Forms](https://github.com/doo/scanbot-sdk-example-xamarin-forms)

Our Barcode Scanner SDK additionally also supports [Compose Multiplatform / KMP](https://github.com/doo/scanbot-barcode-scanner-sdk-example-kmp), [UWP](https://github.com/doo/scanbot-barcode-scanner-sdk-example-windows) (Windows), and [Linux](https://github.com/doo/scanbot-sdk-example-linux).
* [Kotlin Multiplatform](https://github.com/doo/scanbot-barcode-scanner-sdk-example-kmp)
* [Xamarin](https://github.com/doo/scanbot-sdk-example-xamarin)
* [Xamarin.Forms](https://github.com/doo/scanbot-sdk-example-xamarin-forms)
* [Linux](https://github.com/doo/scanbot-sdk-example-linux)
8 changes: 4 additions & 4 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

buildscript {
ext {
buildToolsVersion = "35.0.0"
buildToolsVersion = "36.0.0"
minSdkVersion = 24
compileSdkVersion = 35
targetSdkVersion = 35
compileSdkVersion = 36
targetSdkVersion = 36
ndkVersion = "27.1.12297006"
kotlinVersion = "2.0.21"
}
Expand All @@ -13,7 +13,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle")
classpath("com.android.tools.build:gradle:8.9.1")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
}
Expand Down
8 changes: 8 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,13 @@ target 'scanbotsdkexample' do
:mac_catalyst_enabled => false,
# :ccache_enabled => true
)

installer.pods_project.targets.each do |target|
if target.name == 'fmt'
target.build_configurations.each do |config|
config.build_settings['CLANG_CXX_LANGUAGE_STANDARD'] = 'c++17'
end
end
end
end
end
22 changes: 11 additions & 11 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1779,7 +1779,7 @@ PODS:
- React-utils (= 0.79.0)
- RNFS (2.20.0):
- React-Core
- RNScanbotSDK (8.0.0):
- RNScanbotSDK (9.0.0-src.5):
- DoubleConversion
- glog
- hermes-engine
Expand All @@ -1802,7 +1802,7 @@ PODS:
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- ScanbotSDKNativeWrapper (= 8.0.4.2)
- ScanbotSDKNativeWrapper (= 9.0.3)
- Yoga
- RNScreens (4.10.0):
- DoubleConversion
Expand Down Expand Up @@ -1879,11 +1879,11 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- ScanbotSDK (8.0.4):
- ScanbotSDK/NONE (= 8.0.4)
- ScanbotSDK/NONE (8.0.4)
- ScanbotSDKNativeWrapper (8.0.4.2):
- ScanbotSDK (= 8.0.4)
- ScanbotSDK (9.0.0-RC10):
- ScanbotSDK/NONE (= 9.0.0-RC10)
- ScanbotSDK/NONE (9.0.0-RC10)
- ScanbotSDKNativeWrapper (9.0.3):
- ScanbotSDK (= 9.0.0-RC10)
- SocketRocket (0.7.1)
- Yoga (0.0.0)

Expand Down Expand Up @@ -2205,14 +2205,14 @@ SPEC CHECKSUMS:
ReactCodegen: daf57f5314369a4ad607ee77516d45aad03b10d7
ReactCommon: c07346679f14c0b62ad02b20e18e984da3b575ce
RNFS: 4ac0f0ea233904cb798630b3c077808c06931688
RNScanbotSDK: a24bf34c12e8c8457a55d3b6cb7d06ef5ab3328d
RNScanbotSDK: c39d5ab338f2fea794c7fe3a5790fc7d771a8b69
RNScreens: c5c07a86e4088ce92f0d3854082250dfa9c61f75
RNShare: efd10c48a1c2fa193eac169c4b7798215c16f58d
ScanbotSDK: 0766cf20be136ef1e4e3056ef81b64671bba6e13
ScanbotSDKNativeWrapper: eec855881f03d11c1aeb09c43ca46cd11b531181
ScanbotSDK: 20e63271964984ec72f75b3dd958629998d1ec94
ScanbotSDKNativeWrapper: e7a235a198b88db5ece3feee698eb99e85767588
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
Yoga: 7fb3f48a328f20ea5d5eecd862e91798bd76b255

PODFILE CHECKSUM: 096646d074147bc05d6e271956b1e89cc198190a
PODFILE CHECKSUM: 00629e12fae5d8c078a4c82cec2a4ba72c4905f4

COCOAPODS: 1.15.2
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"set-new-architecture": "sh set-architecture.sh --new",
"set-old-architecture": "sh set-architecture.sh --old"
},
"packageManager": "yarn@3.6.4",
"packageManager": "yarn@4.16.0",
"engines": {
"node": ">=20"
},
Expand All @@ -26,7 +26,7 @@
"react-native-fs": "2.20.0",
"react-native-image-picker": "^8.2.0",
"react-native-safe-area-context": "^5.4.0",
"react-native-scanbot-sdk": "8.0.0",
"react-native-scanbot-sdk": "9.0.0-rc.1",
"react-native-screens": "~4.10.0",
"react-native-share": "12.2.5"
},
Expand Down
52 changes: 52 additions & 0 deletions src/codeSnippets/document/document-enhancer/straightening-image.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import {selectImageFromLibrary} from '@utils';
import {
AspectRatio,
autorelease,
DocumentStraighteningParameters,
ScanbotDocumentEnhancer,
} from 'react-native-scanbot-sdk';

async function straighteningDocument() {
try {
/**
* Select an image from the Image Library
* Return early if no image is selected or there is an issue with selecting an image
**/
const selectedImageResult = await selectImageFromLibrary();
if (!selectedImageResult) {
return;
}

/**
* Note: The result of straightenImage contains an ImageRef, thus
* the autorelease block must be used to properly dispose of the ImageRef.
*/
await autorelease(async () => {
/** Create the default configuration instance */
const straighteningParameters = new DocumentStraighteningParameters();

/** Configure the straightening mode as needed **/
straighteningParameters.straighteningMode = 'STRAIGHTEN';

/**
* The straightening parameters can be customized to fit the expected aspect ratio of the document
* to be straightened. This can help the straightening algorithm to achieve better results.
*/
straighteningParameters.aspectRatios = [
new AspectRatio({width: 5, height: 7}),
new AspectRatio({width: 1, height: 1}),
new AspectRatio({width: 16, height: 9}),
new AspectRatio({width: 3, height: 4}),
];
const result = await ScanbotDocumentEnhancer.straightenImage({
image: selectedImageResult,
straighteningParameters: straighteningParameters,
});

/** Process the result as needed **/
const encodedImage = await result.straightenedImage?.encodeImage();
});
} catch (e: any) {
console.error(e.message);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import {
AspectRatio,
DocumentScanningFlow,
ScanbotDocument,
} from 'react-native-scanbot-sdk';

async function straighteningDocument() {
try {
/** Create the default configuration instance */
const configuration = new DocumentScanningFlow();
const straighteningParameters =
configuration.outputSettings.straighteningParameters;

/** Configure the straightening mode as needed **/
straighteningParameters.straighteningMode = 'NONE';
straighteningParameters.straighteningMode = 'STRAIGHTEN';

/**
* The straightening parameters can be customized to fit the expected aspect ratio of the document
* to be straightened. This can help the straightening algorithm to achieve better results.
*/
straighteningParameters.aspectRatios = [
new AspectRatio({width: 5, height: 7}),
new AspectRatio({width: 1, height: 1}),
new AspectRatio({width: 16, height: 9}),
new AspectRatio({width: 3, height: 4}),
];
/** Start the Document Scanner UI */
const documentResult = await ScanbotDocument.startScanner(configuration);
/** Handle the document if the status is 'OK' */
if (documentResult.status === 'OK') {
}
} catch (e: any) {
console.error(e.message);
}
}
46 changes: 46 additions & 0 deletions src/codeSnippets/document/document-enhancer/straightening-page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import {
AspectRatio,
DocumentStraighteningParameters,
ModifyPageOptions,
ScanbotDocument,
} from 'react-native-scanbot-sdk';

async function straighteningDocument(pageUuid: string, documentUuid: string) {
try {
/** Create the default configuration instance */
const straighteningParameters = new DocumentStraighteningParameters();

/** Configure the straightening mode as needed **/
straighteningParameters.straighteningMode = 'NONE';
straighteningParameters.straighteningMode = 'STRAIGHTEN';

/**
* The straightening parameters can be customized to fit the expected aspect ratio of the document
* to be straightened. This can help the straightening algorithm to achieve better results.
*/
straighteningParameters.aspectRatios = [
new AspectRatio({width: 5, height: 7}),
new AspectRatio({width: 1, height: 1}),
new AspectRatio({width: 16, height: 9}),
new AspectRatio({width: 3, height: 4}),
];

/** Modify the page with the straightening parameters **/
const modifiedDocument = await ScanbotDocument.modifyPage({
pageUuid: pageUuid,
documentUuid: documentUuid,
options: new ModifyPageOptions({
straighteningParameters: straighteningParameters,
}),
});

const modifiedPage = modifiedDocument.pages.find(
page => page.uuid === pageUuid,
)!;
/** Return the newly straightened page */
return modifiedPage.documentImageURI;
} catch (e: any) {
console.error(e.message);
return null;
}
}
40 changes: 27 additions & 13 deletions src/codeSnippets/document/rtuui/scanning-flow/acknowledge-screen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,41 @@ async function startScanning() {
try {
/** Create the default configuration instance */
const configuration = new DocumentScanningFlow();
/** Set the acknowledgment mode */
configuration.screens.camera.acknowledgement.acknowledgementMode = 'ALWAYS';
/** Set the minimum acceptable document quality. */
configuration.screens.camera.acknowledgement.minimumQuality = 'REASONABLE';
const acknowledgementScreenConfig =
configuration.screens.camera.acknowledgement;
/**
* Set the acknowledgment mode
* Modes:
* - UNACCEPTABLE_QUALITY: The acknowledgment screen will only be shown when the quality of a scanned page is unacceptable.
* The quality threshold is determined by the document quality analyzer parameters.
* - ALWAYS: The acknowledgment screen will always be shown after each snap, regardless of the scanned page's quality.
* - NONE: The acknowledgment screen will be disabled, in effect never shown.
*/
acknowledgementScreenConfig.acknowledgementMode = 'UNACCEPTABLE_QUALITY';
/** Set the background color for the acknowledgment screen. */
configuration.screens.camera.acknowledgement.backgroundColor = '#EFEFEF';
acknowledgementScreenConfig.backgroundColor = '#EFEFEF';
/**
* You can also configure the buttons in the bottom bar of the acknowledgment screen.
* E.g., to force the user to retake if the captured document is not OK.
* e.g To force the user to retake, if the captured document is not OK.
*/
configuration.screens.camera.acknowledgement.bottomBar.acceptWhenNotOkButton.visible =
false;
acknowledgementScreenConfig.bottomBar.retakeButton.visible = false;
/** Hide the titles of the buttons. */
configuration.screens.camera.acknowledgement.bottomBar.acceptWhenNotOkButton.title.visible =
acknowledgementScreenConfig.bottomBar.acceptWhenAcceptableButton.title.visible =
false;
acknowledgementScreenConfig.bottomBar.proceedAnywayButton.unacceptableQuality.title.visible =
false;
configuration.screens.camera.acknowledgement.bottomBar.acceptWhenOkButton.title.visible =
acknowledgementScreenConfig.bottomBar.proceedAnywayButton.documentNotFound.title.visible =
false;
configuration.screens.camera.acknowledgement.bottomBar.retakeButton.title.visible =
acknowledgementScreenConfig.bottomBar.proceedAnywayButton.uncertainQuality.title.visible =
false;
/** Configure the acknowledgment screen's hint message which is shown if the least acceptable quality is not met. */
configuration.screens.camera.acknowledgement.badImageHint.visible = true;
acknowledgementScreenConfig.bottomBar.retakeButton.title.visible = false;
/** Configure the acknowledgment screen's hint message which is shown. */
acknowledgementScreenConfig.documentNotFoundWarning.title.text =
'No document found';
acknowledgementScreenConfig.unacceptableQualityWarning.title.text =
'Document quality is unacceptable';
acknowledgementScreenConfig.uncertainQualityWarning.title.text =
'Document quality is unacceptable';
/** Start the Document Scanner UI */
const documentResult = await ScanbotDocument.startScanner(configuration);
/** Handle the document if the status is 'OK' */
Expand Down
Loading