PDF Optimizer

Command Syntax

The command syntax for PDF Optimizer must include:

  1. the executable name
  2. the name of the PDF input file you want to compress
  3. the name you want to assign to the output PDF file
  4. the name of the profile file

The command would look like this:

pdfoptimizer input.pdf output.pdf standard.json

For each command line option, you can also use the short (“-i”) or long (“–input”) notation.

-i [--input] Input file name
-o [--output] Output file name
-j [--profile] Name of the JSON profile

The statement then might look like this:

pdfoptimizer –-input March_Report.pdf --output March_ReportB.pdf --profile standard.json

You don’t need to include a path name for any of these files as long as the input file and profile are stored in the same directory as the program executable, and as long as you save the output file to the same directory as well.

But you of course might want to draw an input file from one directory and save the output to another. In that event you need to provide the path as well as the file name:

pdfoptimizer C:\Datalogics\OptimizedFiles\AnnualReport2016.pdf C:\Datalogics\OutputFiles\AnnualReport2016-B.pdf standard.json

If any of the file or path names include spaces, use quotes around the name:

pdfoptimizer “C:\Datalogics\Optimized Files\Annual Report 2016.pdf” C:\Datalogics\OutputFiles\AnnualReport2016-B.pdf C:\Datalogics\profiles\images.json

The Windows installation program for PDF Optimizer adds the location of the PDF Optimizer executable to the PATH in the Windows Environment Variables. That means that you can run “pdfoptimizer.exe” from anywhere. For Linux, you need to add the location of the PDF Optimizer executable to your PATH variable.