This sample demonstrates how to create a desktop document scanning app using Electron and the Dynamic Web TWAIN SDK for Windows, Linux and macOS.
Refer to https://github.com/electron/electron-quick-start for guidance on setting up a basic Electron application, which requires just these files:
- package.json - Points to the app's main file and lists its details and dependencies.
- main.js - Starts the app and creates a browser window to render HTML, serving as the app's main process.
- index.html - The web page that is rendered, acting as the app's renderer process.
-
Request a trial license and update the license key in
index.html
:Dynamsoft.DWT.ProductKey = 'LICENSE-KEY';
-
Install the dependencies:
npm install -g electron cd app npm install
-
Run the app:
electron . # Or # npx electron .
-
Install asar.
npm install -g asar
-
Package the app:
asar pack app app.asar
-
Download Electron prebuilt package and copy the
app.asar
file to theresources
folder. -
Run the app by executing the Electron binary.