Skip to main content

Auto merge your scans to a duplex using a FTP relay server. Designed to work on Synology DSM Container Manager

Project description

DuplexPDF

DuplexPDF is a simple FTP relay server which allows you to generate duplex scans (front and backed scanned) if your scanner at least support to upload to a FTP server. It works best if you have a ADF (automatic document feeder) which can scan a range of documents fast, but can't scan them on both sides. While designed for Synology DSM and the included Container Manager, you can make it work on any system.

To start, please first make sure you fullfill therequirements:

  • You have a printer that can scan FDPs to FTP
  • You have a FTP server to upload the merged files
  • Your printer is able to name your scans with the 'Duplex1_' or 'Duplex2_' literal followed by the datetime in the following format: YYYYMMDD_hhmmss (for example Duplex1_20251217_135916.pdf)
  • You can run python3 and pip in a Docker container (for example supported by most Synology NAS)

DuplexPDF is configured by environment variables to be easly run in a Docker container

  • duplexPDF_cache: path for cache directory (e.g. /usr/duplexPDF/cache)
  • duplexPDF_log: path for the log directory (e.g. /usr/duplexPDF/log)
  • duplexPDF_incoming_addr: the ip adress and port for the FTP server. IMPORTANT: If your container is running behind a NAT, set here the address you are accessing your NAS. (e.g. 192.168.178.46:1487)
  • duplexPDF_incoming_passive_port_range: the range for PASV commands (e.g. 32000-32005)
  • duplexPDF_incoming_password: the password for the relay FTP server your printer uploads the scanned files to. The username is 'duplexPDF'
  • duplexPDF_outgoing_addr: the ip adress and port for your destination FTP server where the merged files will be send (e.g. 127.0.0.1:21)
  • duplexPDF_outgoing_username: the username for your destination FTP server
  • duplexPDF_outgoing_password: the password for your destination FTP server
  • duplexPDF_outgoing_dir: into this path the merged files will be send
  • duplexPDF_source_port: The port duplexPDF uses to communicate to the destination FTP server (e.g. 1488)

Some important notes:

  • You need to open the ports you specified in the config, usually the duplexPDF_source_port, duplexPDF_incoming_addr (port) and every port in the range of duplexPDF_incoming_passive_port_range
  • DuplexPDF supports FTPS, but can fallback to FTP
  • The cache is only cleared on startup. Everything inside of it except the '.cache', 'ftpd.cert' and 'ftpd.key' can be safely deleted while the container is running

Example configuration on a Synology NAS


You should create a folder for the logs, the cache and the script (run.py)


You need to download the run.py script which installs and runs duplexPDF from PIP


Creating the container in DSM (You don't need to change the IP adress here)


Network settings and the command to execute


Port settings in DSM


Volume settings in DSM


Environment settings in DSM

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

duplexpdf-1.0.2.tar.gz (93.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

duplexpdf-1.0.2-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file duplexpdf-1.0.2.tar.gz.

File metadata

  • Download URL: duplexpdf-1.0.2.tar.gz
  • Upload date:
  • Size: 93.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.7

File hashes

Hashes for duplexpdf-1.0.2.tar.gz
Algorithm Hash digest
SHA256 f62560ddc60e0e068de34f6fa489d3f2fed90f981bde71d08709217427d52fa5
MD5 48312d95a055f69a46a88b43c55a9a03
BLAKE2b-256 a91e3cd1bba1dcd674fe40411eaef6c81ac52f0732a8e1b04838be99ee7a0f87

See more details on using hashes here.

File details

Details for the file duplexpdf-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: duplexpdf-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.7

File hashes

Hashes for duplexpdf-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3e33d59fb151b16428790b838c7db92ea5f61426a59ed414efa4ce7c7a1156c3
MD5 97575f1bfec0d72a9bdcddf7928ac6bb
BLAKE2b-256 e7a8b7e53900db290c761a32746fd7811f7adb1133c97cef34a26470e26c8ac5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page