The command syntax for PDF Optimizer must include:
||name of the PDF input file you want to optimize|
||name you want to assign to the output PDF file|
||name of the JSON profile file|
For each command line option, you can also use the short (“-i”) or long (“–input”) notation.
A command statement for PDF Optimizer 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. The examples that follow are for Windows:
pdfoptimizer --input C:\Datalogics\OptimizedFiles\AnnualReport2016.pdf --output C:\Datalogics\OutputFiles\AnnualReport2016-B.pdf --profile standard.json
If any of the file or path names include spaces, use quotes around the name:
pdfoptimizer --input "C:\Datalogics\Optimized Files\Annual Report 2016.pdf" --output C:\Datalogics\OutputFiles\AnnualReport2016-B.pdf --profile C:\Datalogics\profiles\images.json
Note that PDF Optimizer allows for a command statement syntax that does not include the option notation, for compatibility with previous versions of the software. That is, you can leave out “–input” and “–output” if you already have this command syntax in place in your existing PDF Optimizer work flow. A command that simply lists the name and path of the input file, output file, and JSON profile might look like this:
pdfoptimizer MarchReport2016.pdf MarchReport2016-B.pdf standard.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.