Command-Line Interface (CLI)
About the Command-Line Interface
The Command-Line Interface allows you to run PDFZone from a terminal (ex: Terminal.app). This allows for smooth integration with other softwares. You do not need to run the Graphical User Interface to control the app. Basically, you just need to configure your Models and the extraction zones, then you can run the extraction process from a terminal. This will result in PDFZone producing an output file (CSV) according to your configuration.
Usage
In the terminal (Terminal.app), use the following command pattern:
/Applications/PDFZone.app/Contents/MacOS/PDFZone <config_file.pdfzone> -sourcedir <folder_containing_pdf_files> [-rename] -output <output_file.csv|[rename_directory]>
where:
- The first argument is the full path to the configuration file (.pdfzone). Attention: please read about the attention points below.
- The second argument is the full path to the source directory (= the directory containing the PDF files to analyze). Attention: please read about the attention points below.
- The third argument (optional) is whether the renaming functionality should be used instread of CSV export.
- The last argument is the relative path (relative to to source directory) to the output file (if CSV export) or to the rename directory (if renaming)
Example (CSV export) :
/Applications/PDFZone.app/Contents/MacOS/PDFZone /Users/MyUser/Downloads/MyConfig.pdfzone -sourcedir /Users/MyUser/Downloads/pdfFilesToAnalyze/ -output results.csv
Based on the configuration file MyConfig.pdfzone located in the Downloads folder, this command will run the analysis on the PDF files located in the directory /Users/MyUser/Downloads/pdfFilesToAnalyze/ and write the results in the file /Users/MyUser/Downloads/pdfFilesToAnalyze/results.csv
Example (Renaming) :
/Applications/PDFZone.app/Contents/MacOS/PDFZone /Users/MyUser/Downloads/MyConfig.pdfzone -sourcedir /Users/MyUser/Downloads/pdfFilesToAnalyze/ -rename -output renamedFilesFolder
Based on the configuration file MyConfig.pdfzone located in the Downloads folder, this command will run the analysis on the PDF files located in the directory /Users/MyUser/Downloads/pdfFilesToAnalyze/ and copy+rename the PDF files to the directory /Users/MyUser/Downloads/pdfFilesToAnalyze/renamedFilesFolder/
Attention points
For security reasons due to Apple Sandboxing System, the following points should be fullfilled for the Command-Line mode to work properly:
- The path to the configuration file must be the full path (= not relative) and should be located in the directory (or a sub-directory of) Downloads
- The path to the source directory containing the PDF files to analyze must be the full path (= not relative), and should be located in the directory (or a sub-directory of) Downloads
- The destination directory should be located in the source directory