33 Advanced Features

33.1 Command Line Parameters

The PDF Processor (PDFProcessor.exe) can be controlled via command line parameters. This enables integration into scripts, scheduled tasks, or operation as a Windows service.

Available Parameters

Parameter Short Form Description
--headless -h Starts in headless mode (without GUI dependency)
--run_once -r Performs a single processing run, then exits
--quit -q Terminates a running instance
--profile "Name" -p "Name" Execute only the specified profile
--profiles [A,B,C] -ps [A,B,C] Execute only the specified profiles (comma-separated)

Examples

# Single processing run
PDFProcessor.exe --run_once

# Short form
PDFProcessor.exe -r

# Start as service (endless loop)
PDFProcessor.exe --headless

# Terminate running instance
PDFProcessor.exe --quit

# Headless with single processing
PDFProcessor.exe --headless --run_once

# Process only a specific profile
PDFProcessor.exe --headless --run_once --profile "Invoice Import"

# Process multiple profiles
PDFProcessor.exe -h -r --profiles [Invoices,Archive,Backup]

Profile Selection

With the --profile and --profiles parameters, you can limit processing to specific profiles. This is particularly useful for Windows Task Scheduler when different scheduled tasks should execute different profiles.

Single Profile:

PDFProcessor.exe -h -r -p "Invoice Import"
PDFProcessor.exe --headless --run_once --profile "Orders"

Multiple Profiles:

PDFProcessor.exe -h -r -ps [Invoices,Orders,Archive]
PDFProcessor.exe --headless --run_once --profiles [NightProcessing,Backup]

Profile Names with Commas:

If a profile name itself contains a comma, it must be enclosed in quotes. Both double and single quotes are supported:

# Profile name "Invoices, Import" contains a comma
PDFProcessor.exe -h -r --profiles ["Invoices, Import",Archive]

# With single quotes
PDFProcessor.exe -h -r --profiles ['Invoices, Import',Archive]

# Multiple profiles with commas
PDFProcessor.exe -h -r --profiles ["Invoices, Incoming","Orders, Outgoing",Backup]

# Mixed: profiles with and without commas
PDFProcessor.exe -h -r --profiles [Normal,"With, Comma",AlsoNormal]

Behavior: - Profile names are not case-sensitive (“Invoices” = “invoices” = “INVOICES”) - Non-existent profiles are skipped (with warning in console) - Inactive profiles are also skipped (Active flag takes precedence) - Without profile specification, all active profiles are processed (default behavior)

Console Output:

[08:00:00] Profiles filter: Invoices, Archive

or for all profiles:

[08:00:00] Processing all active profiles

Combinations

Combination Behavior
--headless Autonomous continuous operation without GUI
--run_once Process once, then exit
--headless --run_once Process once without GUI, then exit
--quit Terminate running instance

Exit Codes

Code Meaning
0 Successful termination
1 Unhandled exception
2 License expired or invalid
3 Configuration error
4 Another instance already active

33.2 Headless Mode / Service Operation

In headless mode, PDFProcessor runs without dependency on the GUI application. This is ideal for server operation or running as a Windows service.

Use Cases

Scenario Recommended Parameters
Windows Service --headless
Docker Container --headless
Scheduled Task (one-time) --run_once
Script Integration --headless --run_once

Installation as Windows Service

With NSSM (Non-Sucking Service Manager)

# Install service
nssm install PDFProcessor "C:\...\PDFProcessor.exe" --headless

# Start service
nssm start PDFProcessor

# Stop service
nssm stop PDFProcessor

# Remove service
nssm remove PDFProcessor

With SC (Windows Service Control)

# Create service
sc create PDFProcessor binPath= "C:\...\PDFProcessor.exe -h"

# Set startup type to automatic
sc config PDFProcessor start= auto

# Start service
sc start PDFProcessor

Setting Up Scheduled Tasks

For regular processing without continuous operation:

  1. Open Task Scheduler (taskschd.msc)
  2. Create New Task
  3. Action: Start program → PDFProcessor.exe -r
  4. Trigger: As needed (e.g., hourly, daily)
# Example: Daily processing at 8:00 AM (all active profiles)
schtasks /create /sc daily /tn "PDFProcessor" /tr "\"C:\...\PDFProcessor.exe\" -r" /st 08:00

# Example: Daily invoice processing at 9:00 AM (specific profile only)
schtasks /create /sc daily /tn "PDF Invoices" /tr "\"C:\...\PDFProcessor.exe\" -h -r -p \"Invoice Import\"" /st 09:00

# Example: Nightly archiving at 2:00 AM (multiple profiles)
schtasks /create /sc daily /tn "PDF NightArchive" /tr "\"C:\...\PDFProcessor.exe\" -h -r --profiles [Archive,Backup,Cleanup]" /st 02:00

Tip: With different scheduled tasks for different profiles, you can set up flexible processing scenarios - e.g., invoices hourly during the day, archiving once nightly.

Console Output

In headless mode, the processor outputs status information:

[08:00:00] Automatic PDF Processor 2.0.0 started
[08:00:00] Version: 2.0.0
[08:00:00] License: VALID
[08:00:00] Mode: Headless + RunOnce + Profiles: [Invoices, Archive]
[08:00:00] Profiles filter: Invoices, Archive
[08:00:00] Culture: en-US
[08:00:00] AppData: C:\Users\...\AppData\...

Configuration

Headless mode uses the same configuration as the GUI application: - Configuration Path: %APPDATA%\Gillmeister Software\Automatic PDF Processor 2\ - Profiles: Profiles.json - Options: Options.json

Note: With centralized profile management, the path configured in options is used.


33.3 Processing Time Diagnostics

The diagnostics window provides an overview of processing times and program activity.

Access: Menu ToolsProcessing Time Diagnostics…

Tab: Runtime

Shows program activity for the last 30 days.

Column Description
Date Day of activity
Start Program start time
End End time (or last known activity)
Duration Total runtime

Tab: Global Processing Times

Shows the global time window settings configured in program options: - Active weekdays - Processing period (From/To) - Next scheduled time

Tab: Profile-Specific Processing Times

Lists all profiles that use their own processing times:

Column Description
Profile Profile name
Status Active/Inactive in current time window
Next Window When the next time window begins
Processed Today Number of files processed today

Tab: Waiting Files

Shows files waiting for their time window:

Column Description
File Path to the waiting file
Profile Assigned profile
Waiting Until Start of the next time window

33.4 Catch-Up Processing

The “Catch Up” function allows applying one or more profiles to all PDF files from a specific time period.

How It Works

  1. Select Profiles: Mark the desired profiles in the profile list (multiple selection with Ctrl+Click or Shift+Click possible)
  2. Start Catch-Up: Click Catch Up in the toolbar above the profile list
  3. Set Time Period: If needed, you can restrict the time period (From/To)
  4. Processing: The selected profiles are applied to all PDF files in their monitored folders

Dialog Options

Option Description
From/To Restrict time period (based on file modification date)
Without Restriction Process all files in monitored folders

Use Cases

  • Historical Data: Migrate existing files to a new archive
  • Error Correction: Reprocess files after profile adjustment
  • Manual Trigger: Process files from another source folder
  • Test: Test new profiles with existing files

33.5 Retry on Errors

The retry system enables automatic repetition of failed processing.

Configuration (per Profile)

The retry settings can be found in Profile Settings under GeneralRetries.

Setting Default Description
Active No Enable retries
Maximum Attempts 3 Number of retry attempts
Period 1 hour Attempts are distributed within this period

Interval Calculation

Attempts are distributed evenly over the period:

Attempts Period Interval Between Attempts
3 1 hour 20 minutes
3 3 hours 1 hour
5 1 hour 12 minutes

Period Options

Unit Usage
Seconds For quick retries (e.g., network issues)
Minutes For medium-term retries
Hours For longer-term retries (default)
Days For very long retry periods

Process Flow

  1. Error during processing → File is added to retry list
  2. Wait → System waits for calculated interval
  3. Retry → Processing is attempted again
  4. On success → File is removed from retry list
  5. On another error → Next attempt after another interval

Automatic Cleanup

  • 7-Day Rule: Entries whose last error was more than 7 days ago are automatically removed
  • Maximum Attempts: No further retry is performed after reaching maximum attempts

Retry Status in Log

Errors with active retry function show additional information:

Information Description
Next Attempt Time of next retry attempt
Remaining Number of remaining attempts

Use Cases

Scenario Recommended Configuration
Network Printer 3 attempts, 10 minutes
Email Server 3 attempts, 30 minutes
External Storage 5 attempts, 1 hour
Batch Processing 3 attempts, 2 hours

Example

Configuration: - Maximum attempts: 3 - Period: 1 hour

Process on error at 10:00: 1. First error: 10:00 2. Second attempt: 10:20 3. Third attempt: 10:40 4. Final attempt: 11:00

After the final attempt, the file is marked as “failed” and appears in the log under “Failed Retries”.

Notification on Exhausted Attempts

In the profile notification settings, you can enable email notification when all retry attempts have failed.


33.6 Tips and Notes

Service Operation

  • Permissions: The service runs by default as SYSTEM account. For access to network drives, a user account with appropriate rights must be used.
  • Logging: In headless mode, errors are written to the console and error log.
  • Configuration Changes: Changes to profiles are automatically applied.

Retry Strategy

  • Temporary Errors: Short intervals (minutes) for network issues, printer availability
  • External Dependencies: Longer intervals (hours) for external systems that may be under maintenance
  • Not Too Many Attempts: Too many retries can burden the system

Catch-Up Processing

  • Multiple Profiles: You can select multiple profiles at once to apply them together to a time period
  • Consider Filters: Only files matching profile filters are processed
  • Large Time Periods: Processing may take longer for very large time periods