https://github.com/rverst/pdfmerge
Monitors a directory and merge pdf files based on naming pattern, used for my scan-workflow
https://github.com/rverst/pdfmerge
docker docker-image pdf shellscript
Last synced: about 1 month ago
JSON representation
Monitors a directory and merge pdf files based on naming pattern, used for my scan-workflow
- Host: GitHub
- URL: https://github.com/rverst/pdfmerge
- Owner: rverst
- License: unlicense
- Created: 2020-03-26T14:43:51.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-29T06:55:39.000Z (about 6 years ago)
- Last Synced: 2025-03-02T18:19:11.051Z (over 1 year ago)
- Topics: docker, docker-image, pdf, shellscript
- Language: Shell
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# pdfmerge
 
TL;DR
A docker-container that watches for incoming files (incrond) and merges them together
(using [qpdf](http://qpdf.sourceforge.net)) if needed.
The reason I created this project, is a scanner (HP OfficeJet) whose duplex unit sucks.
It can’t handle folded sheets well (paperjam in 8 out of 10 cases).
So I need to scan the odd and even pages separately and merge them together afterwards.
The docker-container is running on my NAS (QNAP TS-251+) and watches for new files in a mounted volume,
in which the scanner saves it files. The files are prefixed based on scan-profiles and merged based on
these prefixes.
For convenience I reverse the order of the even pages and rotate them by 180 degree during the
merge process. Doing that I can simply take the scanned pages from the output
tray and put them back to the input feeder without the need to rotate and reorder them.
## Example usage:
```console
> docker pull rverst/pdfmerge
> docker run -v /scan_folder:/input \
-v /scan_folder:/output \
rverst/pdfmerge:latest
```
Note that the script runs as UID 1000 and GID 1000 by default. These may be altered with the PUID and PGID environment variables.
## Environment variables:
* PUID - UID to use
* GUID - GID to use
* WAIT_TIMEOUT - timeout in sec. the script waits for a file to close. Should not be to short since some scanners
create the file at the beginning of the scan.
* ROTATE_ODD - rotate the odd pages
* ROTATE_EVEN - rotate the even pages
* REVERSE_EVEN - reverse the order of the even pages
## Alternatives:
* [docker-mergepdf](https://github.com/tuxflo/docker-mergepdf) - Inspiration for this little project.