Skip to content

Commit 445f74e

Browse files
Linux SDK: 8.0.0 (#19)
1 parent 6776f9f commit 445f74e

File tree

139 files changed

+5049
-1121
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+5049
-1121
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
11
.DS_Store
22
statistics.dat
3+
examples/python/__pycache__
4+
examples/c/build/*
5+
examples/nodejs/node_modules
6+
examples/java/libs/*.jar
7+
get-pip.py
8+
.env
9+
.venv

Dockerfile

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
2+
FROM debian:bookworm-slim AS base
3+
4+
# Build Arguments
5+
ARG ARCH
6+
ARG SDK_VERSION
7+
ARG JAVA_VERSION=17
8+
ARG SCANBOT_LICENSE
9+
10+
# Environment Variables
11+
ENV ARCH=${ARCH} \
12+
SDK_VERSION=${SDK_VERSION} \
13+
JAVA_VERSION=${JAVA_VERSION} \
14+
PYENV_ROOT="/opt/pyenv" \
15+
PATH="/opt/pyenv/bin:/opt/pyenv/shims:$PATH" \
16+
SDK_BASE_URL="https://github.com/doo/scanbot-sdk-example-linux/releases/download/standalone-sdk%2Fv" \
17+
SCANBOT_LICENSE=${SCANBOT_LICENSE} \
18+
LANG=C.UTF-8 \
19+
LC_ALL=C.UTF-8
20+
21+
# Install system dependencies
22+
RUN apt-get update && apt-get install -y --no-install-recommends \
23+
# Build tools
24+
build-essential \
25+
cmake \
26+
make \
27+
libssl-dev \
28+
zlib1g-dev \
29+
libbz2-dev \
30+
libreadline-dev \
31+
libsqlite3-dev \
32+
libffi-dev \
33+
liblzma-dev \
34+
# Languages
35+
openjdk-${JAVA_VERSION}-jdk \
36+
# Utilities
37+
curl \
38+
git \
39+
ca-certificates \
40+
# Add Node.js repository and install
41+
&& curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - \
42+
&& apt-get install -y nodejs \
43+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
44+
45+
# Install pyenv and Python 3.6.15
46+
RUN git clone --depth=1 https://github.com/pyenv/pyenv.git $PYENV_ROOT \
47+
&& pyenv install 3.6.15 \
48+
&& pyenv global 3.6.15 \
49+
&& pyenv rehash
50+
51+
# Set JAVA_HOME
52+
RUN export JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::") && \
53+
echo "JAVA_HOME=$JAVA_HOME" >> /etc/environment
54+
55+
ENV PATH="/opt/venv/bin:${PATH}"
56+
57+
# Verify Java installation
58+
RUN java -version && javac -version
59+
60+
# Set up Python packages
61+
RUN export PATH="/opt/pyenv/bin:/opt/pyenv/shims:$PATH" \
62+
&& eval "$(/opt/pyenv/bin/pyenv init -)" \
63+
&& python -m pip install --upgrade pip setuptools wheel \
64+
# The opencv-python version is specified to ensure compatibility with Python 3.6 and speed up docker builds
65+
# Once the python is upgraded to 3.7+, this can be changed to just `opencv-python`
66+
&& python -m pip install opencv-python==4.5.5.64 numpy pillow
67+
68+
# Install Python SDK
69+
RUN if [ "${ARCH}" = "linux-aarch64" ]; then \
70+
PYTHON_ARCH="linux_aarch64"; \
71+
SDK_ARCH="linux-aarch64"; \
72+
else \
73+
PYTHON_ARCH="linux_x86_64"; \
74+
SDK_ARCH="linux-x86_64"; \
75+
fi && \
76+
python -m pip install "${SDK_BASE_URL}${SDK_VERSION}/scanbotsdk-${SDK_VERSION}-py3-none-${PYTHON_ARCH}.whl" && \
77+
echo "Python SDK installed successfully"
78+
79+
# Set working directory and copy source code
80+
WORKDIR /workspaces/scanbot-sdk-example-linux
81+
COPY . .
82+
83+
# Download and install all remaining SDKs in optimal locations
84+
RUN echo "Installing Java and C SDKs for architecture: ${ARCH}" && \
85+
# Set the correct SDK architecture for downloads
86+
if [ "${ARCH}" = "linux-aarch64" ]; then \
87+
SDK_ARCH="linux-aarch64"; \
88+
else \
89+
SDK_ARCH="linux-x86_64"; \
90+
fi && \
91+
# Download platform-dependent SDKs (Java and C only)
92+
curl -L -O "${SDK_BASE_URL}${SDK_VERSION}/scanbotsdk-${SDK_VERSION}-${SDK_ARCH}.jar" && \
93+
curl -L -O "${SDK_BASE_URL}${SDK_VERSION}/scanbotsdk-${SDK_VERSION}-${SDK_ARCH}.tar.gz" && \
94+
# Install Node.js SDK (platform-independent npm package)
95+
cd examples/nodejs && \
96+
npm install "${SDK_BASE_URL}${SDK_VERSION}/nodejs-scanbotsdk-${SDK_VERSION}.tgz" && \
97+
cd /workspaces/scanbot-sdk-example-linux && \
98+
# Setup Java SDK
99+
mkdir -p examples/java/build/libs && \
100+
cp "scanbotsdk-${SDK_VERSION}-${SDK_ARCH}.jar" examples/java/build/libs/scanbotsdk.jar && \
101+
# Setup C SDK
102+
mkdir -p examples/c/build/scanbotsdk && \
103+
tar -xzf "scanbotsdk-${SDK_VERSION}-${SDK_ARCH}.tar.gz" -C examples/c/build/scanbotsdk --strip-components=1 && \
104+
# Clean up downloads
105+
rm -f *.tar.gz *.jar && \
106+
echo "All SDKs installed successfully"
107+
108+
# Copy test scripts
109+
COPY test-scripts/ /tests/
110+
RUN chmod +x /tests/*.sh
111+
112+
# SDK Verification Stage
113+
FROM base AS sdk-verification
114+
RUN echo "=== Comprehensive SDK Verification ===" \
115+
&& python -c "import scanbotsdk; print('Python SDK: Verified')" \
116+
&& cd examples/nodejs && npm install && node -e "const sdk = require('scanbotsdk'); console.log(sdk ? 'OK' : 'FAIL');" \
117+
&& cd /workspaces/scanbot-sdk-example-linux/examples/java && GRADLE_OPTS="-Dfile.encoding=UTF-8" ./gradlew check --no-daemon && echo "Java SDK: Verified" \
118+
&& cd /workspaces/scanbot-sdk-example-linux/examples/c && mkdir -p build && cd build && cmake -DSCANBOTSDK_VERSION=${SDK_VERSION} .. && make && echo "C SDK: OK"
119+
120+
# Python Tests Stage
121+
FROM sdk-verification AS python-tests
122+
RUN echo "=== Running Python Command Tests ===" \
123+
&& /tests/test-python.sh
124+
125+
# Java Tests Stage
126+
FROM sdk-verification AS java-tests
127+
RUN echo "=== Running Java Command Tests ===" \
128+
&& /tests/test-java.sh
129+
130+
# Node.js Tests Stage
131+
FROM sdk-verification AS nodejs-tests
132+
RUN echo "=== Running Node.js Command Tests ===" \
133+
&& /tests/test-nodejs.sh
134+
135+
# C Tests Stage
136+
FROM sdk-verification AS c-tests
137+
RUN echo "=== Running C Command Tests ===" \
138+
&& /tests/test-c.sh
139+
140+
# All Tests Stage
141+
FROM sdk-verification AS all-tests
142+
RUN echo "=== Running Complete Test Suite ===" \
143+
&& /tests/run-all-tests.sh \
144+
&& echo "Python import and commands verified" \
145+
&& echo "Java compilation and commands verified" \
146+
&& echo "Node.js compilation and commands verified" \
147+
&& echo "C compilation and commands verified"
148+
149+

Readme.md

Lines changed: 56 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -5,80 +5,85 @@
55
<img src=".images/ScanbotSDKLogo_darkmode.png#gh-dark-mode-only" width="15%" />
66
</p>
77

8-
# Example App for the Scanbot Linux Barcode Scanner SDK (Beta)
8+
# Example App for the Scanbot Linux SDK
99

10-
This example app demonstrates integrating the Scanbot Linux Barcode Scanner SDK into C++ and Python applications.
10+
This example app demonstrates integrating the Scanbot Linux SDK into Python, Java, Node.js, and C applications.
1111

1212
## What is the Scanbot SDK?
1313

14-
The [Scanbot SDK](https://scanbot.io/?utm_source=github.com&utm_medium=referral&utm_campaign=dev_sites) is a set of high-level APIs that integrates barcode, document scanning and data extraction functionalities into mobile apps, websites, and software server for environments, embedded systems, and edge devices. It operates entirely on-device, and no data is transmitted to our or third-party servers.
14+
The [Scanbot SDK](https://scanbot.io/?utm_source=github.com&utm_medium=referral&utm_campaign=dev_sites) is a set of high-level APIs for implementing **barcode scanning**, **document scanning**, and **data extraction** functionalities into mobile and web apps. The Linux SDK extends the range of platforms to **server environments**, **embedded systems**, and **edge devices**. It uses on-device processing without sending any data to third-party servers.
1515

16-
❗Please note that we currently only offer our **Barcode Scanning SDK for Linux through a closed Beta**. However, the SDK and a trial license are available on request. Please [contact us](mailto:[email protected]) to receive your trial license.
16+
The Scanbot Linux SDK is **a pure C library** and comes with wrappers for **Python**, **Java**, and **Node.js**, making it compatible with a wide range of development environments. On devices with **TensorRT support**, like the NVIDIA Jetson, GPU acceleration increases the barcode scanning speed up to 3x.
1717

18-
Refer to the respective README files in the examples' directories for more details.
18+
💡 For more details about the Scanbot SDK, check out the [documentation](https://docs.scanbot.io/?utm_source=github.com&utm_medium=referral&utm_campaign=dev_sites).
1919

20-
## Barcode Scanner SDK
20+
## Technical requirements
2121

22-
The Scanbot Linux Barcode Scanner SDK extracts barcode data from images. It returns this information as a simple list. The SDK is perfect for deployment on private clouds, drones, robots, and edge devices running Ubuntu, Raspberry Pi OS, or Debian.
22+
- **Supported platforms:**
2323

24-
### Technical requirements
24+
- **Linux systems with glibc ≥ 2.27** (e.g., Ubuntu 18.04 / 20.04 / 22.04 LTS, Debian 11 / 12, Raspberry Pi OS 64-bit)
2525

26-
* **Supported architectures**: ARM64 and x86_64.
27-
* **Camera**: Camera with autofocus and at least 720p resolution.
28-
* **GPU support**: Uses GPU acceleration on platforms with TensorRT, such as NVIDIA Jetson.
26+
- **NVIDIA Jetson devices**
2927

30-
### Performance overview
28+
* **Supported architectures**:
29+
* ARM64 and x86_64
30+
* **Camera**:
31+
* Camera with autofocus and at least 720p resolution
32+
* **GPU support**:
33+
* Uses GPU acceleration on platforms with TensorRT, such as NVIDIA Jetson
3134

32-
Performance with a 1280x720 input image size with NEXT_GEN engine mode:
33-
| Device | Frame-rate |
34-
|---------------------------------------------------|------------|
35-
| Raspberry Pi 4 | ~8.5 FPS |
36-
| NVidia Jetson Orin Nano 8GB | ~40 FPS |
37-
| NVidia Jetson Orin Nano 8GB with GPU acceleration | ~85 FPS |
35+
## Performance overview
3836

39-
### Supported barcodes
37+
Performance with a 1280x720 input image size and using the `NEXT_GEN` engine mode:
38+
| Device | Framerate |
39+
| ------------------------------------------------- | --------- |
40+
| Raspberry Pi 4 | ~8.5 FPS |
41+
| NVidia Jetson Orin Nano 8GB | ~40 FPS |
42+
| NVidia Jetson Orin Nano 8GB with GPU acceleration | ~85 FPS |
4043

41-
The Scanbot Barcode Scanner SDK supports all common 1D- or 2D barcode formats, including:
44+
## Feature overview
4245

43-
| Barcode type | Barcode symbologies |
44-
|:-------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
45-
| 1D Barcodes | [EAN](https://scanbot.io/barcode-scanner-sdk/ean/?utm_source=github.com&utm_medium=referral&utm_campaign=dev_sites), [UPC](https://scanbot.io/barcode-scanner-sdk/upc/?utm_source=github.com&utm_medium=referral&utm_campaign=dev_sites), [Code 128](https://scanbot.io/barcode-scanner-sdk/code-128/?utm_source=github.com&utm_medium=referral&utm_campaign=dev_sites), [GS1-128](https://scanbot.io/barcode-scanner-sdk/gs1-128/?utm_source=github.com&utm_medium=referral&utm_campaign=dev_sites), [Code 39](https://scanbot.io/barcode-scanner-sdk/code-39/?utm_source=github.com&utm_medium=referral&utm_campaign=dev_sites), [Codabar](https://scanbot.io/barcode-scanner-sdk/codabar/?utm_source=github.com&utm_medium=referral&utm_campaign=dev_sites), [ITF](https://scanbot.io/barcode-scanner-sdk/itf-code/?utm_source=github.com&utm_medium=referral&utm_campaign=dev_sites), Code 25, Code 32, Code 93, Code 11, MSI Plessey, Standard 2 of 5, IATA 2 of 5,  Databar (RSS), GS1 Composite |
46-
| 2D Barcodes | [QR Code](https://scanbot.io/glossary/qr-code/?utm_source=github.com&utm_medium=referral&utm_campaign=dev_sites), Micro QR Code, [Aztec Code](https://scanbot.io/barcode-scanner-sdk/aztec-code/?utm_source=github.com&utm_medium=referral&utm_campaign=dev_sites), [PDF417 Code](https://scanbot.io/barcode-scanner-sdk/pdf417/?utm_source=github.com&utm_medium=referral&utm_campaign=dev_sites), [Data Matrix Code,](https://scanbot.io/barcode-scanner-sdk/data-matrix/?utm_source=github.com&utm_medium=referral&utm_campaign=dev_sites) [GiroCode](https://scanbot.io/glossary/giro-code/?utm_source=github.com&utm_medium=referral&utm_campaign=dev_sites), [NTIN Code](https://scanbot.io/glossary/gtin/?utm_source=github.com&utm_medium=referral&utm_campaign=dev_sites), [PPN](https://scanbot.io/glossary/ppn/?utm_source=github.com&utm_medium=referral&utm_campaign=dev_sites), [UDI](https://scanbot.io/glossary/udi/?utm_source=github.com&utm_medium=referral&utm_campaign=dev_sites), [Royal Mail Mailmark](https://scanbot.io/barcode-scanner-sdk/royal-mail/?utm_source=github.com&utm_medium=referral&utm_campaign=dev_sites), MaxiCode |
46+
- [Barcode scanning](https://docs.scanbot.io/linux/barcode-scanner-sdk/introduction/)
47+
- [Document scanning](https://docs.scanbot.io/linux/document-scanner-sdk/introduction/)
48+
- [Document quality analysis](https://docs.scanbot.io/linux/document-scanner-sdk/08-document-quality-analyzer/introduction/)
49+
- [OCR (optical character recognition)](https://docs.scanbot.io/linux/data-capture-modules/ocr/introduction/)
50+
- [Text pattern scanning](https://docs.scanbot.io/linux/data-capture-modules/text-pattern-scanner/introduction/)
51+
- [MRZ scanning](https://docs.scanbot.io/linux/data-capture-modules/mrz-scanner/introduction/)
52+
- [Document data extraction](https://docs.scanbot.io/linux/data-capture-modules/document-data-extractor/introduction/)
53+
- [VIN (vehicle identification number) scanning](https://docs.scanbot.io/linux/data-capture-modules/vin-scanner/introduction/)
54+
- [Credit card scanning](https://docs.scanbot.io/linux/data-capture-modules/credit-card-scanner/introduction/)
55+
- [Check (MICR) scanning](https://docs.scanbot.io/linux/data-capture-modules/check-scanner/introduction/)
56+
- [Medical certificate scanning](https://docs.scanbot.io/linux/data-capture-modules/medical-certificate-scanner/introduction/)
4757

48-
## Additional information
58+
## Licensing and pricing
4959

50-
### Guides and Tutorials
60+
A trial license key is required for evaluation or testing. To get a free trial license, please contact us at [email protected].
5161

52-
Integrating the Scanbot Barcode Scanner SDK takes just a few minutes, and our step-by-step guides make the process even easier.
62+
[Contact our team](https://scanbot.io/contact-sales/?utm_source=github.com&utm_medium=referral&utm_campaign=dev_sites) to receive your quote.
5363

54-
💡Please check out our [Linux Tutorial ](https://scanbot.io/techblog/c-plus-plus-barcode-scanner-raspberry-pi-tutorial/?utm_source=github.com&utm_medium=referral&utm_campaign=dev_sites)for an overview of how to get started.
64+
## Running Tests
5565

56-
Alternatively, visit our [developer blog](https://scanbot.io/techblog/?utm_source=github.com&utm_medium=referral&utm_campaign=dev_sites) for a collection of in-depth tutorials, use cases, and best practices for the Scanbot SDK.
66+
The test scripts validate SDK integration, detect compilation errors, and check license issues across all supported languages (Python, Java, Node.js, C).
67+
[Detailed documentation](test-scripts/README.md)
5768

58-
### Free integration support
69+
## Other supported platforms
5970

60-
Need help integrating our barcode scanning software into your Linux apps? We offer [free developer support](https://docs.scanbot.io/support/?utm_source=github.com&utm_medium=referral&utm_campaign=dev_sites) via Slack, MS Teams, or email.
71+
The Scanbot SDK is also available on Android, iOS, and most common cross-platform environments, such as React Native, Flutter, and .NET MAUI:
6172

62-
As a customer, you also get access to a dedicated support Slack or Microsoft Teams channel to talk directly to your Customer Success Manager and our engineers.
73+
- [Android](https://github.com/doo/scanbot-sdk-example-android) (native)
74+
- [iOS](https://github.com/doo/scanbot-sdk-example-ios) (native)
75+
- [Web](https://github.com/doo/scanbot-sdk-example-web)
76+
- [React Native](https://github.com/doo/scanbot-sdk-example-react-native)
77+
- [Flutter](https://github.com/doo/scanbot-sdk-example-flutter)
78+
- [Capacitor & Ionic (Angular)](https://github.com/doo/scanbot-sdk-example-capacitor-ionic)
79+
- [Capacitor & Ionic (React)](https://github.com/doo/scanbot-sdk-example-ionic-react)
80+
- [Capacitor & Ionic (Vue.js)](https://github.com/doo/scanbot-sdk-example-ionic-vuejs)
81+
- [.NET MAUI](https://github.com/doo/scanbot-sdk-maui-example)
82+
- [Xamarin](https://github.com/doo/scanbot-sdk-example-xamarin) & [Xamarin.Forms](https://github.com/doo/scanbot-sdk-example-xamarin-forms)
83+
- [Cordova & Ionic](https://github.com/doo/scanbot-sdk-example-ionic)
6384

64-
### Licensing and pricing
6585

66-
A trial license key is required for evaluation or testing. To get a free "no-strings-attached" trial license, please request one [here](mailto:[email protected]).
6786

68-
Our pricing model is simple: Unlimited barcode scanning for a flat annual license fee, full support included. There are no tiers, usage charges, or extra fees. [Contact](https://scanbot.io/contact-sales/?utm_source=github.com&utm_medium=referral&utm_campaign=dev_sites) our team to receive your quote.
69-
70-
### Other supported platforms
71-
72-
Besides Linux, the Scanbot Barcode Scanner SDK is also available on:
73-
74-
* [Android (native)](https://github.com/doo/scanbot-barcode-scanner-sdk-example-android)
75-
* [iOS (native)](https://github.com/doo/scanbot-barcode-scanner-sdk-example-ios)
76-
* [JavaScript (web)](https://github.com/doo/scanbot-barcode-scanner-sdk-example-web)
77-
* [React Native](https://github.com/doo/scanbot-barcode-scanner-sdk-example-react-native)
78-
* [Flutter](https://github.com/doo/scanbot-barcode-scanner-sdk-example-flutter)
79-
* [Capacitor & Ionic](https://github.com/doo/scanbot-barcode-scanner-sdk-example-capacitor-ionic)
80-
* [Cordova & Ionic](https://github.com/doo/scanbot-barcode-scanner-sdk-example-cordova-ionic)
81-
* [.NET MAUI](https://github.com/doo/scanbot-barcode-sdk-maui-example)
82-
* [Xamarin & Xamarin.Forms](https://github.com/doo/scanbot-barcode-scanner-sdk-example-xamarin)
83-
* [Compose Multiplatform / KMP](https://github.com/doo/scanbot-barcode-scanner-sdk-example-kmp)
84-
* [UWP](https://github.com/doo/scanbot-barcode-scanner-sdk-example-windows) (Windows SDK)
87+
- Barcode scanning only:
88+
- [Compose Multiplatform / KMP](https://github.com/doo/scanbot-barcode-scanner-sdk-example-kmp)
89+
- [UWP](https://github.com/doo/scanbot-barcode-scanner-sdk-example-windows) (Windows)

0 commit comments

Comments
 (0)