Getting Started with pdfHarmony


This chapter tells you what you need to know to get started with pdfHarmony…

you will learn:

  • The basic structure of  pdfHarmony commands
  • How to get product information about your installation of pdfHarmony

pdfHarmony Command Basics

All pdfHarmony commands that you run from the command line start with the pdfharmony command name. The command name is followed by one or more options, which begin with a dash. Commands that you use to obtain information about a PDF document must also include an input file specification. For example, the following command instructs pdfHarmony to optimize the PDF file:

$pdfharmony -optimize -o pathname\output.pdf  pathname\myfile.pdf

Note:  $ represents the command prompt. Two command options that do not require any PDF input, and therefore do not include an input file specification, are -v and -h.

Displaying the Product Version Number

It is a good idea to test your installation of pdfHarmony by displaying the product version number. You will also need this number if you ever contact Appligent’s Customer Support with a question.


$pdfharmony -v


The following listing is typical of the output you would receive. In addition to the product version number, it contains the release date and registration number.  It also indicates that the registration number is valid.

Typical listing produced by -v option

# Copyright XXXX by Appligent, Inc.
# Written by Mark Gavin
# Version X.X, Build Date XXXX, Library Version X.X.X
# License is valid.

Displaying Product Usage Information

If you have a question about the command syntax or a command option, you can get help by displaying product usage information.


$pdfharmony -h

Typical listing produced by -h or -help option

Usage: pdfHarmony [options] inPDFFile1 [inPDFFile2 …]

 -verifyonly : Verify Only, search for corrupt files without creating any new files
-o <string> : Output directory name or PDF filename
-verifypage : Verify page drawing
— Document Save, Optimize & Compression Options —
-flate : Encode any non-encoded streams using Flate compression
-rascii : Remove ASCII85 filters from all streams
-nolzw : Replace LZW encoded streams with Flate encoding
-optxobj : Merge identical XObjects and Images
-optcontent : Optimize common sequences in page content
-optfonts : Merge identical font descriptors and encodings
-optimize : Combine -flate, -rascii, -nolzw, -optxobj, -optcontent and -optfonts
-nocomp : Do not compress using Object Streams; compatible with all versions of Acrobat
-comp : Compress using Object Streams; Acrobat 6 and later
-cstruct : Compress logical structure -nocomp, -comp and -cstruct are mutually exclusive; these options can all be off, but only one can be used at a time.
-xreadonly : Suppresses the generation of padding in the XMP Metadata
-xpadding <int> : XMP Metadata padding bytes. Default is 2048
-iso32000 : Set file for ISO 32000 compliance (PDF 1.7)
-w : Save the output as a linearized file
-wauto : Auto-detect linearized and save linearized; otherwise save normal
-wforms : Extends “-w” and “-wauto” to linearize Acrobat Forms; default is not to linearize forms. requires “-w” or “-wauto”
-nomod : Retain current file modification date
-nosign : Ignore Digital Signatures; default is to incrementally save files with digital signatures
— Document Metadata —
-title <string> : Document title
-author <string> : Author of the document
-subject <string> : Subject of the document
-keyword <string> : Keywords associated with the document ( separated by commas )
-addinfo : Add the new information to any existing in the file.
-custom <string> : Custom document information
-custom “name,value” name and value are separated by a comma; this option may be repeated.
— Document Open & Layout Options —
-pageMode <string> : Set the document’s Page Mode ( DontCare | UseNone | UseThumbs | UseBookmarks | Fullscreen | UseOC | UseAttachments )
-layout <string> : Set the document’s layout ( single | oneColumn | twoColLeft | twoColRight | twoPageLeft | twoPageRight )
-openAction <string> : Set the document’s Open Action ( FitPage | FitWidth | FitHeight | FitBoundingBox )
-openToPage <int> : Open the document to the given page number.
-hideToolbar : Hide the toolbar upon opening the document.
-hideMenubar : Hide the menubar upon opening the document.
-hideWinUI : Hide scrollbars and other controls upon opening the document.
-fitWin : Resize the window to the initial page.
-centerWin : Center the window on the screen.
-showTitle : Display document title in windows title bar.
-LeftToRight : Left to Right reading order used to determine relative position of pages for side by side display.
-RightToLeft : Right to Left reading order; includes vertical writing systems like Chinese, Japanese, and Korean.
— Bookmarks —
-openBookmarks : Open all bookmarks.
-closeBookmarks : Close all bookmarks.
-openLevel <int> : Open all bookmarks up to and including this level.
-removeBookmarks : Remove all bookmarks.
— Annotations & Form Fields —
-removeAnnots : Remove all Annotations including notes, highlights, form fields, etc.
-removeFields : Remove all form fields.
— Watched Folders —
-watch <string> : path to watched folder base directory
-watchin <string> : path to input watched folder; optional
-watchout <string> : path to output of watched folder; optional
-d <string> : Owner password to open this document
-l <string> : Write progress to the given log file name
-p : Write progress information to diagnostics
-html <string> : Output results to HTML file.
-htmlurl <string> : Specify path to server hosting HTML support files.
-v : Print version information
-r <string> : pdfHarmony serial number
-h : Show help
-help : Show help