TAV-OCR was developed to allow easy scan of a QR code on any document following by any action.
The default action is move
which will read the QR code from a scanned pdf file, with a random printer generate name, and move it to a shared folder while changing the file name to a more human-friendly name.
This project is supported by TAV Medical Ltd.
- Download and install Node.js.
- Fork/Download/Git clone this repository.
- Run install.bat (just doing
npm install
to install dependencies). - Run using
node index.js
or Install as a service. - Change configuration in
./config
folder
- Open a new command prompt window.
- Run
npm run-script install-windows-service
to install a new service namedtav-ocr
. - Open Services & start the service.
- To uninstall run
npm run-script uninstall-windows-service
.
All logs are being saved in console.log
to allow easy debugging when running as a service.
- All configuration files are located in
./config
folder. - Contributors: use
./config/private
to continue using this project while making changes in the branch.
- General app settings.
Argument | Required? | Details |
---|---|---|
folderToWatch | * | Folder to watch for files |
smtp | Using Nodemailer Single Connection |
- QR code x,y scan coordinates.
{
"array": [
{
"x": 145, // x position to **start** the square
"y": 100, // y position to **start** the square
"squareSize": 100 // square size to scan QR code
},
{"x": 125, "y": 70, "squareSize": 135 }...
]
}
- action types
{
"action-name": {
// File destination template
// $var_name$ will be replaced using QR code data
"path": "\\\\SERVER\\Path\\Quality Assurance\\$pn$\\$lot$\\MO-$pn$-$lot$-$mo$-$today$.pdf",
// custom function name - using move as defualt
"function": "move",
// [Nodemailer Single Connection](https://nodemailer.com/smtp/#1-single-connection)
"smtp": {
"email": "group@domain.com",
"subject": "MO-$pn$-$lot$-$mo$"
}
},
"action-name-2": ...
}
When contributing to this repository, please first discuss the change you wish to make via issue or email before making a push.
- When writing/rewriting make sure to comment with as much information as you can
- Make sure to test as you write to prevent any errors
- Always push to dev branch
- If approved - the changes are going to get tested using dev branch