-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #362 from sbs20/staging
Localisation and optional geometry
- Loading branch information
Showing
31 changed files
with
667 additions
and
273 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,8 @@ on: | |
branches: | ||
- 'master' | ||
- 'staging' | ||
tags: | ||
- 'v*' | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
docker: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,9 @@ RUN apt-get update \ | |
&& sed -i \ | ||
's/policy domain="coder" rights="none" pattern="PDF"/policy domain="coder" rights="read | write" pattern="PDF"'/ \ | ||
/etc/ImageMagick-6/policy.xml \ | ||
&& sed -i \ | ||
's/policy domain="resource" name="disk" value="1GiB"/policy domain="resource" name="disk" value="8GiB"'/ \ | ||
/etc/ImageMagick-6/policy.xml \ | ||
&& npm install -g [email protected] | ||
|
||
# Create a known user | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Integration | ||
|
||
It's not uncommon to want to integrate scanservjs with other software - you may | ||
wish to upload scans to Dropbox, paperless-ng or some other location. The | ||
possibilities are endless and deep integration into the UI would add cruft for | ||
the vast majority of users. | ||
|
||
Thankfully, the files just end up in a location on your filesystem so you are | ||
free to integrate however you want. | ||
|
||
The recommended way is to create a script or program which scans the output | ||
directory for files and then does something with them. | ||
|
||
## paperless-ng | ||
|
||
[This discussion](https://github.com/sbs20/scanservjs/issues/351#issuecomment-913858423) | ||
about paperless-ng resulted in | ||
[scantopl](https://github.com/Celedhrim/scantopl) | ||
|
||
## Dropbox | ||
|
||
You could integrate with Dropbox using | ||
[Dropbox-Uploader](https://github.com/andreafabrizi/Dropbox-Uploader) | ||
|
||
## Scan2Mail | ||
|
||
1. Setup and configure [msmtp](https://wiki.debian.org/msmtp) and msmtp-mta as | ||
described | ||
[here](https://decatec.de/linux/linux-einfach-e-mails-versenden-mit-msmtp/) | ||
2. Install the MIME packer [mpack](https://linux.die.net/man/1/mpack) with | ||
`sudo apt install mpack` to send the scanned files | ||
3. Setup [OCRmyPDF](https://github.com/jbarlow83/OCRmyPDF) as described | ||
[here](https://ocrmypdf.readthedocs.io/en/latest/installation.html) | ||
|
||
Now create the following pipeline in your `config/config.local.js` | ||
|
||
```javascript | ||
config.pipelines.push({ | ||
extension: 'pdf', | ||
description: 'ocrmypdf (Scan2Mail [email protected])', | ||
get commands() { | ||
return [ | ||
'convert @- -quality 92 tmp-%04d.jpg && ls tmp-*.jpg', | ||
'convert @- pdf:-', | ||
`file="scan_$(date +"%d_%m_%Y-%H_%M").pdf" && ocrmypdf -l ${config.ocrLanguage} --deskew --rotate-pages --force-ocr - "$file" && mpack -s "Document from Scanner@Office" "$file" [email protected]`, | ||
'ls scan_*.*' | ||
]; | ||
} | ||
}); | ||
``` | ||
|
||
The important `Scan2Mail` line is: | ||
|
||
``` | ||
file="scan_$(date +"%d_%m_%Y-%H_%M").pdf" && ocrmypdf -l ${config.ocrLanguage} --deskew --rotate-pages --force-ocr - "$file" && mpack -s "Document from Scanner@Office" "$file" [email protected] | ||
``` | ||
|
||
This sets a time-based filename, then OCRs and finally sends to | ||
[email protected] | ||
|
||
## Other recipes? | ||
|
||
If you have other recipes then please share them. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ const Constants = { | |
'es', | ||
'fr', | ||
'it', | ||
'nl', | ||
'pl', | ||
'pt-BR', | ||
'ru', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.