Skip to content

Scan documents from the browser using JS/TS with NAPS2.Sdk

License

Notifications You must be signed in to change notification settings

cyanfish/naps2-webscan

Repository files navigation

NAPS2.WebScan

NAPS2.WebScan contains sample code for scanning from a web browser in JavaScript/TypeScript using NAPS2.Sdk.

How does this work?

Consider a corporate network with an intranet site we want to add scanning capabilities to. Users will scan using a scanner attached to their local machine and then upload it to the intranet server.

  • NAPS2.WebScan.LocalService is a Windows Service we would install on every client machine. It shares scanning devices attached to the local machine using ESCL, which is a standard HTTP protocol the browser can connect to.
  • NAPS2.WebScan.WebServer is an example web server with JS/TS client code for scanning (in practice you would integrate the code with your existing server).

Note that while the sample service code is designed for Windows, the concept can easily be extended cross-platform.

How do I build the JS/TS code?

  • cd NAPS2.WebScan.WebServer
  • npm install
  • vite build

Where's the interesting code?

How do I set option X for scanning?

Have a look at IScanSettingParams and the whole types folder for the type definitions. The ESCL spec may also be helpful.

How do I scan multiple pages from a feeder?

Keep calling NextDocument until it errors with a 404.

Still having trouble?

Feel free to create an issue.

About

Scan documents from the browser using JS/TS with NAPS2.Sdk

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published