Skip to content

Conversation

yurii-scanbot
Copy link
Collaborator

No description provided.

@yurii-scanbot yurii-scanbot changed the title Prepare for stable RC Prepare/restructure for stable RC Aug 18, 2025
@yurii-scanbot yurii-scanbot changed the title Prepare/restructure for stable RC [EPIC-6378] Prepare/restructure for stable RC Aug 26, 2025
@yurii-scanbot yurii-scanbot marked this pull request as ready for review September 3, 2025 11:15

### Install the Scanbot SDK
Replace `<SCANBOT_SDK_VERSION>` with the actual version number of the SDK you want to install.
```bash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually in examples we do this like

export SCANBOT_SDK_VERSION=<SCANBOT_SDK_VERSION>
npm install https://github.com/doo/scanbot-sdk-example-linux/releases/download/standalone-sdk%2Fv$SCANBOT_SDK_VERSION/nodejs-scanbotsdk-$SCANBOT_SDK_VERSION.tgz

So that you have to replace the version only in one place.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replaced with export SCANBOT_SDK_VERSION=<SCANBOT_SDK_VERSION>

"typescript": "^5.9.2"
},
"dependencies": {
"scanbotsdk": "https://github.com/doo/scanbot-sdk-example-linux/releases/download/standalone-sdk%2Fv0.800.3/nodejs-scanbotsdk-0.800.3.tgz"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you specify url here, then there is no need to install package manually as it is specified in the readme

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed to completely remove url from dependencies


if (images && images.length > 0) {
for (let imageIndex = 0; imageIndex < images.length; imageIndex++) {
const extractedImage = images[imageIndex]?.image;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no explanation why this inner await using is needed. In java examples we explain that the images are initially stored in a compressed way and we do this in order to prevent a lot of decompressed images to be stored in memory

export async function applyBinarizationFilter(image: ScanbotSDK.ImageRef, path: string): Promise<void> {
await using imageProcessor = await ScanbotSDK.ImageProcessor.create();
const filter = new ScanbotSDK.CustomBinarizationFilter({ preset: "PRESET_4" });
await using filtered_img = await imageProcessor.applyFilter(image, filter);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filteredImg

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed

Replace `<SCANBOT_SDK_VERSION>` with the actual version number of the SDK you want to install.
* **On ARM64 (Raspberry Pi, Jetson Nano, etc.):**
```bash
pip install https://github.com/doo/scanbot-sdk-example-linux/releases/download/standalone-sdk%2Fv<SCANBOT_SDK_VERSION>/scanbotsdk-<SCANBOT_SDK_VERSION>-py3-none-linux_aarch64.whl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the old example we had

export SCANBOT_SDK_VERSION=<SCANBOT_SDK_VERSION>

and then used this variable in installation scripts, it allows to specify this version only once. Relates to all the readmes

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replaced with export SCANBOT_SDK_VERSION=<SCANBOT_SDK_VERSION>

}

// TODO Add your SCANBOTSDK_API_TOKEN and SCANBOTSDK_VERSION here.
// They are available on request via [email protected]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are available on request via [email protected]

Probably no need to remove this line

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed [email protected] in all places

)
# Configure other parameters as needed.

file_access_source = RandomAccessSource(file_path=file_path)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to do like this:
with RandomAccessSource(file_path=file_path) as file_access_source: ...
The file will in any case be automatically closed when the variable goes out of scope (as we override __del__ for the class but standard practise in python when dealing with files to use context managers and for this we also implement context manager functions for the class

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants