- 1 Introduction to Command-Line Options
- 2 General options
- 3 General options detailed
- 3.1 -r <RegNum> — Pass registration number to StampPDF Batch
- 3.2 -l <logfile> — Log to a log file (optional)
- 3.3 -p — Show progress (optional)
- 3.4 A note on using -p and -l <logfile> together
- 3.5 -n — Do not write anything to screen (optional)
- 3.6 -v — Print version information (optional)
- 3.7 -h or -help — Show usage (optional)
- 3.8 -o <outFile.pdf> — Save to a new file or directory (required)
- 3.9 -overwrite — Save the output to the input PDF file (optional)
- 3.10 -d <string> — Owner password to open the document (optional)
- 3.11 -w — Linearize the file upon save (optional)
- 3.12 -i — Perform incremental save (optional)
- 3.13 -optimize — Optimize the file (optional)
- 3.14 -nocomp — Do not compress using Object Streams (optional)
- 3.15 -comp — Compress using Object Streams (optional)
- 3.16 -iso32000 — Set file for ISO 32000-1 compliance (optional)
- 3.17 -listfonts — Print a list of available fonts in the appligent_home fonts folder
- 3.18 -listundo — Print a list of undo labels in the document
Introduction to Command-Line Options
Command-line options are used in all Appligent Document Solutions server applications. The general options deal with product information, progress messages, and file maintenance. The following sections detail the use of these options.
The following table provides a summary of the general command-line options:
|-r||<RegNum>||Pass registration number to StampPDF Batch|
|-l||<logFile>||Write progress information to logfile|
|-p||Provide progress messages|
|-n||Do not write anything to screen|
|-v||Display version information|
|-h or -help||Display usage information|
|-o||<outFile.pdf>||Save output to a new file or directory|
|-overwrite||Save the output to the input PDF file|
|-d||<string>||Owner password to open this document|
|-w||Linearize the file upon save|
|-i||Perform incremental save|
|-optimize||Optimize the output file to try to reduce file size|
|-nocomp||Do not compress using Object Streams (resulting file is compatible with all versions of Acrobat)|
|-comp||Compress using Object Streams (resulting file requires Acrobat 6 and later)|
|-iso32000||Set file for ISO 32000 compliance (PDF 1.7)|
|-listfonts||Print a list of available fonts in the appligent_home fonts folder|
|-listundo||Print a list of undo labels in a the document|
The following sections provide details on using the general command-line options.
-r <RegNum> — Pass registration number to StampPDF Batch
This option can be used to supply your registration number to StampPDF Batch from a script or another application:
$stamppdfapp -r XXXX-XXXX-XXXX-XXXX-XXXX-XXXX [other options]
This option is typically not necessary and is available for use in cases where the Appligent License File can not be located by the application because of runtime environment restrictions.
-l <logfile> — Log to a log file (optional)
Write to a text file any errors and progress messages. A log file is created only when errors are present. This option is helpful for debugging. The -l <logfile> option must be followed by a file name. Your log file will look different if you are also using the -p option.
Note: If the log file you specify is a read-only file, a warning is displayed and nothing is written to the log file. Make sure that your log file is write-enabled.
-p — Show progress (optional)
Write progress messages to the screen STDOUT, the standard output of your system. This option is helpful for debugging and for understanding how StampPDF Batch works.
A note on using -p and -l <logfile> together
As outlined in the above sections the -p option gives you progress messages on your screen and the -l <logfile> option writes error messages to a file if errors occur. The table below provides more detail on using these options alone or together.
|✔||Nothing will be written to the screen or to the log file you specify|
|✔||Progress message will be written to the screen and stamppdf.log|
|✔||✔||Progress messages will be written to the screen and to the log file you specify|
|✔||A stamppdf.log file will be created with the errors in your working directory|
|✔||✔||Errors will be written to the log file you specify|
|✔||✔||Errors will be written to stamppdf.log and your screen|
|✔||✔||✔||Both progress and error messages will be written to the screen and to the log file you specify|
Therefore, -l <logfile> used on its own will only go into action if there are errors. With -p and -l <logfile> combined, you will get a text file with full details on StampPDF Batch operations whether there are errors or not.
-n — Do not write anything to screen (optional)
Do not write anything to the screen (or STDOUT). If you are running batch mode, this prevents progress messages from building up.
-v — Print version information (optional)
Display the version of StampPDF Batch you are running. This is important when corresponding with us via firstname.lastname@example.org. In order to best understand your problem, we must know what version of the software you have. StampPDF Batch will not do anything else if you use this option.
-h or -help — Show usage (optional)
Display all available command-line options. StampPDF Batch will not do anything else if you use either of these options.
-o <outFile.pdf> — Save to a new file or directory (required)
When processing one input file, specify an output file for the results. If you are processing more than one input file at a time, specify an existing directory for the resulting files. When you stamp several files at one time and use the -o option, make sure to specify the name of an existing directory.
ADVISORY: We recommend that you always specify a new output file name so that your original file will remain unchanged.
-overwrite — Save the output to the input PDF file (optional)
This flag will allow you to overwrite the input PDF file you are stamping. You do not specify a file name after -overwrite on the command line. Example: stamppdf -overwrite Stamp.txt Input.pdf
-d <string> — Owner password to open the document (optional)
If the PDF document you wish to stamp has been encrypted, you must pass the owner password with the -d <string> option in order to stamp the file. If you are processing more than one input file at a time, the owner password must be the same for all files.
-w — Linearize the file upon save (optional)
Save the output file as a linearized document. Linearization reorganizes the file to make it more efficient for web delivery. Individual pages can be rendered before the entire document has downloaded, so the user can start reading the document sooner.
-i — Perform incremental save (optional)
An incremental save appends changed information to the end of the file. This is faster than a full save, but may result in a larger file. A full save is similar to using the “Save As…” command in Adobe Acrobat. It is a save that attempts to clean up a PDF file, often reducing its size.
Note: There are four new options available in StampPDF Batch 5.x and later.
-optimize — Optimize the file (optional)
This flag will do the following: 1) encode any non-encoded streams using Flate compression, 2) remove ASCII85 filters from all streams, 3) replace LZW encoded streams with Flate encoding, 4) merge identical XObjects and images, 5) optimize common sequences in page content, and 6) merge identical font descriptors and encodings. This option will usually result in a smaller file size.
-nocomp — Do not compress using Object Streams (optional)
This flag will not compress Object Streams, resulting in a document that is compatible with all versions of Acrobat.
-comp — Compress using Object Streams (optional)
This flag will compress Object Streams, resulting in a document that is compatible with Acrobat 6.0 and later.
-iso32000 — Set file for ISO 32000-1 compliance (optional)
This flag sets the file for compliance with ISO 32000-1:2008 (PDF 1.7).
-listfonts — Print a list of available fonts in the appligent_home fonts folder
This flag lists all the fonts that are available to stamp using StampPDF Batch. StampPDF Batch version 5.2 now supports OpenType and TrueType fonts in addition to Postscript Type 1 fonts.
Below is a small example of some of the fonts that are shipped with StampPDF Batch. You will see these when you run -listfonts:
There are two font directories.
The default font directory is found under the AppligentHome directory in APDFLX.X.XResource/Font. On Windows, the AppligentHome directory is in the AllUsers Application data directory.
Windows 7 and later: C:\ProgramData\Appligent
You can also specify an additional font directory, the AP font directory. The path to the AP font directory is saved in an environment variable called AP_FONT_DIR. You will be prompted to enter a font directory during installation. The fonts that are in the AP_FONT_DIR will also show in addition to the fonts that are shipped with StampPDF Batch when you run -listfonts.
On Windows: Environment variables can be set on Windows under the System Properties. To display the System Properties, right click on “My Computer” and select properties. On the bottom of the Advanced tab, click the button labeled “Environment Variables”. Under system variables, you will see an entry for AP_FONT_DIR. Select this entry, and click edit. You can then change the
variable’s value to the path of the current font directory.
On Unix: As the other environment variables for StampPDF Batch, AP_FONT_DIR is set in the stamppdf script. The directory set in an environment variable in the script, or be set for the shell.
-listundo — Print a list of undo labels in the document
This flag lists all the undo labels that are set in the stamp file and can help when trying to remove a stamp with the -u flag.