Using Quick Check directly on the command line

Note: As with any other use of the command line version of pdfToolbox (or actually any command line tool), at least some familiarity with the use of applications in a command line environment is required.

Looking up calling conventions for Quick Check

Using ./pdfToolbox --help quickcheck an overview of the usage of the Quick Check feature on the command line is shown:

./pdfToolbox --help quickcheck
Usage:
  pdfToolbox --quickcheck [--satellite_type=satellite_type] [--timeout_satellite=timeout_satellite] [--timeout_dispatcher=timeout_dispatcher] [--nolocal] [--endpoint=endpoint] [--dist] [--timeout=timeout] [-l=l] [--cachefolder=cachefolder] [--noprogress] [-t] [--nooptimization] [-o=o] [-f=f] [-w] [-s=s] <config file> <input file>
Purpose:
  Performs a QuickCheck
Options:
      --satellite_type      Distribute to satellite with specific type
      --timeout_satellite   Time interval before processing of job is cancelled on satellite
      --timeout_dispatcher  Time interval before search for available satellite is cancelled (s.a. --nolocal)
      --nolocal             do not process locally, return error in case of timeout
      --endpoint            dispatcher url
      --dist                distribute execution to satellites
      --timeout             Time interval before local processing of job is cancelled
  -l  --language            Reporting language (e.g. en (English, default), de or fr)
      --cachefolder         Sets the cache folder path
      --noprogress          Switches off progress information
  -t  --timestamp           show time stamp in output
      --nooptimization      The internal PDF structure is not optimized
                            when saving the PDF.
  -o  --outputfile          Destination for modified input file(s)
  -f  --outputfolder        Puts modified input file(s) into folder
  -w  --overwrite           Overwrites existing files (default: index file name)
  -s  --suffix              Adds suffix to modified file(s)
Arguments:
  config file   Configuration for the QuickCheck
  input file    File to be processed
Click to copy

In most cases it will be sufficient to

  1. point to a suitable configuration file
  2. indicate the PDF file to be analyzed by Quick Check
  3. where to write the resulting JSON file

Thus an example call might look like this:

./pdfToolbox --quickcheck -o=demo.json sample.cfg demo.pdf 
Click to copy

Note: In the article "All aggregated Quick Check objects and output" you can find a list of all "aggregated" filter expressions which you can copy into a configuration file.

The above syntax will not overwrite existing JSON files, but instead will append a 4 digit number to a newly created JSON file if a file with the same name as the requested name already exists. In order to enforce that the JSON file is always written with the requested name (and a pre-existing file with the same name is overwritten) the following call may be used (via the -w option):

./pdfToolbox --quickcheck -o=demo.json -w sample.cfg demo.pdf 
Click to copy

Example

Copy these contents to notepad and save the configuration file as 'sample.cfg':

$.direct: false
$.aggregated: false
$.aggregated.pages.page.info.pagenum: true
$.aggregated.pages.page.geometry.TrimBox.width_eff: true
Click to copy

Executing the command for a 4 page test PDF would result in something like:

{
  "aggregated": {
    "pages": {
      "page" : [
        {
          "info" : {
            "pagenum" : 1
          },
          "geometry" : {
            "TrimBox" : {
              "width_eff" : 425.197,
              "height_eff" : 651.968
            }
          }
        },
        {
          "info" : {
            "pagenum" : 2
          },
          "geometry" : {
            "TrimBox" : {
              "width_eff" : 425.197,
              "height_eff" : 651.968
            }
          }
        },
        {
          "info" : {
            "pagenum" : 3
          },
          "geometry" : {
            "TrimBox" : {
              "width_eff" : 425.197,
              "height_eff" : 651.968
            }
          }
        },
        {
          "info" : {
            "pagenum" : 4
          },
          "geometry" : {
            "TrimBox" : {
              "width_eff" : 425.197,
              "height_eff" : 651.968
            }
          }
        }
      ]
    }
  },
  "status": {
    "time_needed_sec" : 0.000002,
    "result" : "complete"                                                                                                                                                                                                                                                                                                                                                                                                                                                        
  }
}
Click to copy