In this chapter…

…you will learn about the options available within AppendPDF Pro.

AppendPDF Pro Options

Refer to General Command-Line Options for details on the general options.
Refer to Applying Standard Security for more information about the security options and working with encrypted documents.

The following is an example of command syntax for AppendPDF Pro.

$ appendpro [options] parameterfile1.txt [parameterfile2.txt...]

The table below shows command-line options for AppendPDF Pro.

Options summary

-cmds filename.txt Process a collection of files to run at one time.
-b Include bookmarks.
-f Start page numbering from the first page.
-extra Include named destination bookmarks, links, and article threads.
-eb Keep embedded files.
-u  string Remove old stamps with UndoLabel
-listfonts Print list of available fonts in the appligent_home fonts folder
-vars string List of variables to be substituted in the Stamp file (“name,value,name,value”)
-vardelimiter  string Delimiter character for variables in the Stamp File ( default is % )
-portfolio icons|details Build PDF Portfolio, also called Portable Collection

-cmds — Allows you to process a collection of commands at one time  (optional)

To process multiple commands quickly and efficiently, use the -cmds  option.  The file specified by -cmds, the commands file, should contain one or more single-line commands.  Each command is just like an ordinary AppendPDF Pro command line without the executable name. The commands file does not support wildcards in file names. The following is an example of command-line syntax when running with -cmds:

$ ./appendpro -p -l logfile.txt -cmds CommandFile.txt

CommandFile.txt contains a list of commands for AppendPDF Pro to process. Below is an example of CommandFile.txt:

-p -iso32000 /appligent/appendpro/samples/parameters.txt
-p -iso32000 /appligent/appendpro/samples/paramsbasic.xml
-p -optimize /appligent/appendpro/samples/tutorial.txt
-p -w /appligent/appendpro/samples/paramscomplete.xml

-b — Include bookmarks (optional)

Specifies to include the bookmarks of the original PDF files in the new, appended document. If a page (or pages) from an input document has a bookmark, that bookmark will appear in the bookmarks list, in the correct order, in the final appended document.

Note: AppendPDF Pro handles bookmarks that have been created using “Named Destinations” in a special way. If a file has bookmarks with Named Destinations and you append it using -b, AppendPDF Pro will convert the Named Destinations to Regular Destinations and then make the bookmark. Other Named Destinations that are not bookmarks will be ignored.

-f — Start page numbering from the first page (optional)

Specifies to start counting pages from the first page of the completed document. This option will include the cover page and table of contents in the page numbering. The stamp files determine how a document is numbered. The stamp file in the Extras block will only stamp the documents that are listed in the Source block. Using the -f option, AppendPDF Pro will count the pages of the cover and TOC and start numbering the body documents at the next number.

For example, if there is one page for the cover and two pages for the TOC, the page number stamped on the first page of the body document will be 4. If -f is not used, page numbering will reset to 1 at the body of the appended documents. The cover and Table of Contents will have their own numbers.

Note: Acrobat and Acrobat Reader often start numbering with the first page of the document. The -f option ensures that the page numbers in the Table of Contents match the page numbers in Acrobat’s navigation pane.

-extra — Copy named destination bookmarks/links and article threads (optional)

This flag will copy any named destination bookmarks/links, and article threads into the appended document. The -extra flag will only include named destination bookmarks/links and article threads when appending complete documents.  If you are specify a page range for your input files and -extra is on the command line,  no extra bookmarks or article threads will be copied over into the appended document.

-eb — Keep embedded files (optional)

AppendPDF Pro will keep any embedded files included in input files as part of the final output file. This option supports any file type that Adobe Acrobat can embed into a PDF document.

-u  — Remove old Stamps with UndoLabel

Removes stamps that were labeled with  in the stamp file. AppendPDF Pro cannot remove stamps applied without an UndoLabel. When removing a stamp, you must supply a parameter file on the command line at the same time.

-listfonts — Prints a list of available fonts for use with AppendPDF Pro. 

This flag lists all the fonts that are available to stamp using AppendPDF Pro. AppendPDF Pro version 5.5 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 AppendPDF Pro.  You will see these when you run -listfonts:


There are two font directories.

The default font directory is found under the AppligentHome directory in APDFL10.1.0a/Resource/Font. On Windows, the AppligentHome directory is in the AllUsers Application data directory.

Windows XP: C:\Documents and Settings\All Users\Application Data\Appligent
Windows Vista and later: C:\ProgramData\Appligent
Unix: /usr/local/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 AppendPDF Pro 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 AppendPDF Pro, AP_FONT_DIR is set in the appendpro script. The directory set in an environment variable in the script, or be set for the shell.

Command Line Variable Substitution

-vars — List of variables to be substituted in the Stamp File ( “name,value,name,value” )

**On Windows, do not use * or ? as the vardelimiter because these are wildcard characters that might lead to unintended consequences**

AppendPDF Pro will be able to replace variables found within the stamp file, and thus substitute the text that it stamps based on parameters set on the command line. If the text of an item contained in the stamp file contains one or more pairs of percent signs, the text between each pair of percent signs is the name of a variable to be replaced.

The command line uses the “-vars” flag to assign a value to each stamp. AppendPDF Pro replaces each variable name (including the percent signs) by its value. The first part is the variable name set in the stamp file and the information following after the comma is the value for that variable. For example, if you have Text Parameters set with %First_Name% and %Last_Name% in the stamp file, your command line would look similar to the example below:

appendproapp -p -vars "First_Name,Jane,Last_Name,Doe" ParamFile.txt

There are rules that govern text replacement:

  • Variable names can consist of some characters from the ASCII range 32-126, including upper and lower case letters, numbers, spaces (but not leading or trailing spaces), and underscores.
  • Values can contain any UTF-8 characters except null.
  • Two consecutive commas in a value field are treated not as separators, but as a single comma that is part of the value.
  • A %variable-name% in the stamp file Text parameter that is not part of the -vars option will be left unchanged, but be aware that the percept sign, when coupled with the character following it, could be construed as a stamp variable, leading to unexpected results.
  • When you specify -vars on the command line, each stamp must have an even number of percent signs. If you want to mix new text replacement variables and traditional stamp variables in the same stamp file, you will need to add an additional percent sign in front of the AppendPDF Pro built-in variable. The Text Parameters in your stamp file would look similar to the example below:
    Text (Page %%g) —- this is an AppendPDF Pro built-in variable for Page number. Add an extra % in front of the %g variable

    Text (My Full Name is %First_Name% %Last_Name%)

    If you omit the -vars flag from the command line, %%g in the Text parameter above will be stamped as %g on the output PDF file.

  • You can also add AppendPDF Pro built-in variables to the command line. Please note, you need to add double quotes around the built-in variables on Windows and single quotes on Unix.  Example of Text Parameter in the stamp file:
    Text (Today is %My_Date%)
    WINDOWS:  appendproapp.exe -p -vars "My_Date,%c" ParamFile.txt
    Unix:  appendproapp -p -vars 'My_Date,%c' ParamFile.txt

NOTE:  Text substitution on the command line must be composed of letters, numbers, underscores, and spaces, with no leading or trailing space.

-vardelimiter —Delimiter character for variables in the Stamp File ( default is % )

**On Windows, do not use * or ? as the vardelimiter because these are wildcard characters that might lead to unintended consequences**

By default the character used to surround the variable name is the percent sign (%) character. This option allows you to use some other character beside the percent sign.

Notes about Command Line Variable Substitution

Microsoft attaches special meaning to a bunchOfCharsbunchOfChars%. So, there may be cases where the user tries to use percent signs in the values in -vars, but Microsoft intervenes.

Another place where Microsoft uses percent signs is in the syntax of its DOS for command. There could be some misinterpretation.

Additional Notes:

  1. On Unix or Linux, enclose the objects of ‘-vars’ and ‘-vardelimiter’ in (single quotes).  This will prevent the shell from modifying the text.
  2. On Windows, enclose the object of “-vars” in double quotes.  This instructs Windows to treat the quoted text as a single entity.
  3. On any platform, the vardelimiter should not be any character that appears in the stamp file.
  4. On windows the vardelimiter should be neither * or ? because these are wildcard characters that might lead to unintended consequences.  On Unix/Linux, these characters are acceptable provided you enclose the vardelimiter character in apostrophes.
  5. If you specify  “-vardelimiter” , neither the delimiter nor a percent sign may appear inside the “-vars” string.
  6. On Windows, if the “-vars” option contains percent signs inside a batch (*.bat) file, each percent sign must be doubled.  If the “-vars” option contains percent signs inside a batch file, and if this text is passed to another batch file,  each percent sign must be quadrupled.  Et cetera..

PDF Portfolio

-portfolio <icons|details> — Build PDF Portfolio, also called Portable Collection

Instead of reassembling the PDF document by appending pages together; a PDF Portfolio inserts the documents without altering the content of the original component files.  This allows any file type, even files which are encrypted or digitally signed, to be added to the PDF Portfolio without first converting to PDF or changing the encryption on the documents or breaking the digital signatures.  Output PDF Portfolios can only be viewed under Acrobat/Reader XI and DC.

Digitally Signed Files

Files containing digital signatures can be inserted into a PDF Portfolio without breaking or altering the digital signature in any way.

Encrypted Files

Files can be encrypted using different combinations of owner passwords, user passwords and permissions.

Non-PDF Files

A PDF Portfolio supports non-PDF file types for example; Microsoft Office documents including Word, Excel and Powerpoint, TIFF image files, Photoshop files, Video files, XML Based XFA files, etc.

Notes about PDF Portfolios

  1. Portable Collections are only supported under Acrobat XI & DC
  2. TOC page & stamping on output files is not supported.  Cover page can be added but stamping on this page is not supported (At times a blank cover page may appear briefly on the screen when viewing the portable collection)
  3. Individual pages and page ranges are not supported. The entire document will be appended
  4. If the order of the output files does not appear correct, click on the “Description” Column to sort the order