{{sidenavigation.sidenavigationExpandLabel}}
{{getMsg('Help_YouAreHere')}}: {{page.title}} {{page.title}}

{{$root.getMsg("downLoadHelpAsPdf")}} {{helpModel.downloadHelpPdfDataStatus}}

Command Line Access

To compare PDF files with a result output in form of images and a difference log, you can execute i-net PDFC on a command line. To start it manually the i-net PDFC SDK (https://download.inetsoftware.de/pdfc-sdk-latest.zip) contains the start files compare.bat for Windows and compare.sh for Unix/Linux.

Usage

compare(.bat/.sh) [<Option>] [<Folder1> <Folder2> | <File1> <File2>]
compare(.bat/.sh) -activate <activation key>
compare(.bat/.sh) -generateinfo
Mode Description
<Option> Normal operation mode of i-net PDFC. Please see below for specific options. This mode requires two more parameters which can either be two files or two folder.
-activate Activates your copy of i-net PDFC with the activation key generated when you purchased a license. If you have not purchased a license, a 30-day trial license key will be generated for you.
-generateinfo In case you do not have internet access to activate your license, this generates an info you can send to pdfc@inetsoftware.de. Run it like 'compare.sh -generateinfo > Info.txt' and send the file Info.txt to pdfc@inetsoftware.de
Parameter Description
-parameters <File> Sets a parameters file. The parameters in the file can be separated with whitespace or line break
-c | -config <File> Specifies the configuration file (config.xml) for i-net PDFC. If none is specified, the default "config.xml" will be used.
-root | -r <Path> Sets the root folder for difference images and comparison report. If this parameter is specified, i-net PDFC creates a sub-directory for each pair of PDF files beneath the root directory. Otherwise it is using the working directory. In this sub-directory it stores the page images and difference images in the directory "differences".
-i Creates difference images in <working directory>/differences for any differences found. Recommended for a graphical comparison. Same as "-fs"
-f Creates diff images for any differences found for the first file
-s Creates diff images for any differences found for the second file
-x Creates XOR difference images, may be combined with -i. If this parameter is specified, the difference image contains a third image in which the images of both sides are laid over one another, so that small differences can be seen more clearly.
-o Creates images for each page of each version. Recommended for debug purposes.
-e Creates a report providing an overview about differences found in the PDF files; maps to export report
-p Creates a comparison PDF file visually showing the differences between the compared PDF files; maps to export printPDF
-export <List> A list of export formats to generate. Formats are:
print - Print full document view to the default printer
printPDF - Print full document view as a PDF file; similar to -p
printPNG - Print full document view as PNG images
image - Creates diff images for any differences found for both files; similar to -i
report - Creates a report providing an overview about differences found in the PDF files; similar to -e
-loglevel<Level> Sets the log level. Available levels are "DEBUG", "OFF", "ERROR", "WARN", "INFO", "ALL". This option replace the profile setting LOG_LEVEL. The profile setting LOG_LEVEL shouldn't used anymore, that will be removed soon.
-logmaxerror<Number> Sets the maximum number of differences for the console or log output. All futher differences will be counted but not show in detail. Default output is 100 differences. Available values [0 - ca. 2 million].This option replace the profile setting MAX_ERRORS_PER_FILE. The profile setting MAX_ERRORS_PER_FILE shouldn't used anymore, that will be removed soon.
-logfile<File> Sets the log file path and file name. This option replace the profile setting LOG_FILE. The profile setting LOG_FILE shouldn't used anymore, that will be removed soon.
-imagescale<ratio> Sets the scale for image export. Available values [0.1 - 100.0].This option replace the profile setting IMAGE_SCALE_FACTOR. The profile setting IMAGE_SCALE_FACTOR shouldn't used anymore, that will be removed soon.
-landscape Sets the export format to landscape. Works only in combination with -p or -export

Additional options for the print/PDF/PNG export:

Parameter Description
-m | -minimize Collapses all pages without differences and show only pages with differences
-header <bool> Enables (true) or disables (false) the additional page header and footer
-scaletofit <bool> Enables (true) or disables (false) scale to fit for single sided export, has no effect if sides=both
-overlap <ratio> Enables the overlay mode and sets the opacity, values may range from 0 to 1
-exportOnlyOnDifferences <bool> If activated (true), PDF files and images will only be exported in case of differences
-types <List> A list of difference types to report. Values are:
addremove - Show added and removed elements
replaced - Show replaced text
modified - Show style changes
meta - Show page format changes in strict mode
-highlights <List> A list of all filters that are allowed to highlight the elements they have modified / excluded. Values are:
annotation - Shows annotations in the original files, if any
invisible - Outlines invisible elements
headerfooter - Shows the excluded header and footer
unicode - Outlines replaced ambiguous Unicode text
multicolumn - Outlines detected columns
regexp - Outlines words that were matched and excluded
-sides <Side> Defines which sides to export when using print, PDF or PNG export. Values are:
both - Default, show both documents side by side
left - Export only the left / first document
right - Export only the right / second document

Note: Values of type ''<List>'' are always comma separated. There must be no spaces in the list value!

Additional options for the report generation:

Parameter Description
-format Defines the format / file type of the report
pdf - Portable document format
xls - Excel Spreadsheet, Excel 95 and later
xlsx - Excel Spreadsheet, for version 2007 and later
ods - Open Document Spreadsheet
rtf - Rich Text Format

Note: if you are using two folders, the PDF files must have the same name in both folders.

It is also possible to configure the parameter values using the file config.xml.

Examples

Assuming you installed i-net PDFC into the directory "C:/PDFC" and the sub-directories "folder1" and "folder2" contain PDF files with the same name, you can start the comparison with the following command:

  • compare.bat folder1 folder2 - This will compare all PDF files in the folder "folder1" with the PDF files of the same name in the folder "folder2" and will result in an output on the console for any differences found between the compared PDF files in "folder1" and "folder2".
  • compare.bat -i folder1 folder2 - In addition to the console output this creates PNG images in the subfolder "<working directory>/differences" in which any detected differences that were found are marked in color.
  • compare.bat -i -o folder1 folder2 - This creates additional PNG images for each page of the compared PDF files in the subfolder "<working directory>/differences/<pdf-file-name>" with the original page content.
  • compare.bat -i -o folder1 folder2 > pdfc.log - Additionally you can write the console output in a file. With the parameter LOG_LEVEL you can disable the log output and configure the amount of log output.

You can do the same with single PDF files:

  • compare.bat -i D:/my-PDF-files/file1.pdf D:/my-PDF-files/file2.pdf > pdfc.log - This will compare both PDF files and create the difference images in the folder "<working directory>/differences".
 
This application uses cookies to allow login. By continuing to use this application, you agree to the use of cookies.