Automatically print PDF files from a watched folder. When a PDF file is synchronized/copied to the configured folder, it will be sent to the printer automatically.
- Folder Monitoring: Watches a folder for new PDF files
- Automatic Printing: Sends new files to a configured printer
- Sync-Safe: Waits for files to be fully written before printing
- File Management: Option to move or delete files after printing
- Configurable: JSON configuration file for all settings
- Logging: Detailed logging to console and file
- Windows 10/11
- Python 3.8+
- Adobe Acrobat or Acrobat Reader (recommended for
acrobatprint method)
-
Install Python dependencies:
pip install -r requirements.txt
-
List available printers:
python folder2print.py --list-printers
-
Edit
config.jsonwith your settings:watch_folder: The folder to monitor for PDF filesprinter_name: The printer to use (leave empty for default printer)
Edit config.json:
{
"watch_folder": "C:\\Sync\\PDFs",
"printer_name": "HP LaserJet Pro",
"check_interval_seconds": 1,
"delete_after_print": false,
"move_after_print": true,
"printed_folder": "printed",
"file_extensions": [".pdf"],
"print_delay_seconds": 2,
"move_delete_delay_seconds": 60,
"print_method": "acrobat",
"acrobat_path": "C:\\Program Files\\Adobe\\Acrobat DC\\Acrobat\\Acrobat.exe"
}| Option | Description | Default |
|---|---|---|
watch_folder |
Folder path to monitor for new files | Required |
printer_name |
Printer name (use --list-printers to see options) |
Default printer |
check_interval_seconds |
How often to check for changes | 1 |
delete_after_print |
Delete files after printing | false |
move_after_print |
Move files to subfolder after printing | true |
printed_folder |
Subfolder name for printed files | "printed" |
file_extensions |
File types to monitor | [".pdf"] |
print_delay_seconds |
Extra delay before printing (for sync) | 2 |
move_delete_delay_seconds |
Delay before moving/deleting after print | 60 |
print_method |
Printing method: acrobat or shellexecute |
"acrobat" |
acrobat_path |
Path to Acrobat executable (auto-detected if empty) | Auto-detect |
acrobat (recommended): Uses Adobe Acrobat/Reader command line (/t switch) for reliable silent printing. The path is auto-detected from common installation locations, or you can specify it manually.
Common Acrobat paths:
- Acrobat DC:
C:\Program Files\Adobe\Acrobat DC\Acrobat\Acrobat.exe - Acrobat Reader DC:
C:\Program Files\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe
shellexecute: Uses Windows ShellExecute with the "print" verb. Works with any PDF application but may show dialogs.
python folder2print.pypython folder2print.py myconfig.jsonpython folder2print.py --list-printersOption 1: Startup Folder
- Press
Win + R, typeshell:startup, press Enter - Create a shortcut to
run_folder2print.batin that folder
Option 2: Task Scheduler
- Open Task Scheduler
- Create Basic Task
- Trigger: "When I log on"
- Action: Start a program
- Program:
pythonw.exe - Arguments:
"C:\GitHub\folder2print\folder2print.py" - Start in:
C:\GitHub\folder2print
Option 3: Using pythonw.exe (no console window)
pythonw.exe folder2print.pyLogs are written to:
- Console output (when running manually)
folder2print.logfile in the script directory
- Ensure you have at least one printer installed
- Run
--list-printersto verify
- The file may still be syncing
- Increase
print_delay_secondsin config
- Install Adobe Acrobat or Acrobat Reader
- Set
acrobat_pathin config.json to the correct path - Or switch to
"print_method": "shellexecute"
- Check the log file
folder2print.logfor errors - Verify Acrobat can open the PDF manually
- Try switching
print_methodbetweenacrobatandshellexecute
- Check that
watch_folderpath is correct - Ensure the folder exists
- Check file extension matches
file_extensionsconfig
- Increase
move_delete_delay_secondsto give more time for printing - Check printer queue in Windows settings
- Verify printer is online and has paper
MIT License