PDF Enhancement CLI
The VIESUS PDF processing tool handles PDF documents containing embedded images, with support for both automated and direct processing modes.
PDF CLI Modes
PDF Version Information
Parameter | Description |
---|---|
-v | Print version information and exit |
PDF Hotfolder Mode
Hotfolder mode provides automated PDF processing by monitoring a designated folder for new files.
Basic Syntax
viesusPDF -h [-g <guid>] [options]
Parameters
Parameter | Required | Description |
---|---|---|
-h | Yes | Start application in hotfolder mode |
-g <guid> | Optional | Start with specific GUID (library-dependent) |
Usage Example
# Start in hotfolder mode
viesusPDF -h
# Start with specific GUID
viesusPDF -h -g 12345678-1234-1234-1234-123456789abc
PDF Stand-Alone Mode
Stand-alone mode processes individual PDF files or folders directly from the command line.
Basic Syntax
viesusPDF <source> <destFolder> <viesusIniFile> [options]
Required Parameters
Parameter | Position | Type | Description |
---|---|---|---|
<source> | 1 | String | Path to PDF file or source folder |
<destFolder> | 2 | String | Path to destination folder for processed files |
<viesusIniFile> | 3 | String | Path to INI file containing VIESUS enhancement settings |
Optional Parameters
Optional parameters can appear in any order after the required parameters.
File Handling Options
Parameter | Type | Description |
---|---|---|
[deleteSrc] | Flag | Delete source files after successful processing |
[archive <path>] | String | Archive original files to specified folder path |
[useSoftMasked] | Flag | Enable processing of images with soft masks |
[justAnalyze] | Flag | Analyze and count images only (results in status file) |
Page Processing Options
Parameter | Format | Description |
---|---|---|
-s <pages> | String | Skip specified pages (stand-alone mode only) |
Page Skip Format:
f
= first pagel
= last page- Numbers = specific page numbers
- Example:
-s f,l,5,10,14
(skip first, last, and pages 5, 10, 14)
Network and Debugging Options
Parameter | Type | Default | Description |
---|---|---|---|
-p <portNr> | Integer | 12033 | Port number for TraceConsumer |
Image Processing Options
Parameter | Type | Default | Description |
---|---|---|---|
[noResize] | Flag | Off | Disable resizing of small images |
-r <targetRes> | Integer | 300 | Target resolution in DPI for size calculations |
-T <resizeThres> | Float | 1.2 | Minimum factor required to trigger resizing |
PDF Usage Examples
PDF Stand-Alone Mode Examples
Basic Processing
viesusPDF "C:\input\document.pdf" "C:\output" "C:\config\enhance.json"
With Archive and Source Deletion
viesusPDF "C:\input\document.pdf" "C:\output" "C:\config\enhance.json" deleteSrc archive "C:\archive"
Skip Specific Pages
viesusPDF "C:\input\document.pdf" "C:\output" "C:\config\enhance.json" -s "1,3,5"
Analysis Only
viesusPDF "C:\input\document.pdf" "C:\output" "C:\config\enhance.json" justAnalyze
Custom Resolution and Resize Settings
viesusPDF "C:\input\document.pdf" "C:\output" "C:\config\enhance.json" -r 600 -T 1.5
Batch Processing with Custom Port
viesusPDF "C:\input\folder" "C:\output" "C:\config\enhance.json" -p 15000 useSoftMasked
Complex Example
viesusPDF "C:\batch\pdfs" "C:\enhanced" "C:\settings\config.json" deleteSrc archive "C:\backup" useSoftMasked -r 400 -T 1.3 -p 15000
PDF Parameter Details
Source Path
- File: Process single PDF file
- Folder: Process all PDF files in the specified directory
- Must be accessible and contain valid PDF files
Destination Folder
- Must exist or be creatable by the application
- Processed files will be saved with enhanced images
- Original PDF structure is preserved
INI Configuration File
- Contains VIESUS enhancement parameters
- Must be valid INI format
- See VIESUS parameter documentation for configuration options
Archive Behavior
- Original files are copied to archive folder before processing
- Only occurs if
archive <path>
parameter is specified - Archive folder is created if it doesn't exist
Page Skipping
- Only available in stand-alone mode
- Useful for excluding cover pages, blank pages, or specific content
- Pages are numbered starting from 1
Resize Logic
- Images smaller than target resolution are candidates for resizing
resizeThres
determines minimum scale factor to trigger enhancementnoResize
flag completely disables image resizing
Common Processing Workflows
# 1. Process PDF with archiving
viesusPDF "document.pdf" "output" "config.json" archive "backup"
# 2. Batch process folder
viesusPDF "pdf_folder" "enhanced_pdfs" "config.json" deleteSrc
Best Practices
- Validate paths before running batch operations
- Use appropriate resize thresholds to balance quality and processing time
- Archive originals when processing important documents
- Monitor memory usage with large PDF files containing many images
Performance Considerations
- Batch Processing: Use folder input for better performance on multiple files
- Memory Usage: Large PDFs with many images may require significant memory
- Resize Threshold: Higher values reduce processing time but may skip beneficial enhancements
- Soft Masked Images: Enabling may increase processing time but improves quality
- Thread count (-T): Use number of CPU cores for optimal performance
- Multi-threading is not possible when using GPU features with a single GPU
- Network paths: Avoid processing over slow network connections when possible
- checkAdjacentImages: Disable for complex PDFs with many small images
- streamReading: Disable if processing PDFs with compressed image content
- Super Resolution: All modes except mode 6 significantly increase processing time
- maxFactor: Limit to prevent excessive memory usage on large images and PDFs
- debug: Disable in production for better performance