In This Chapter…

…we show how to use FDFMerge Pro:

FDFMerge Pro is command-line driven. Refer to the Getting Started with Command Line Applications if you are not familiar with using command-line tools.

Using Command-Line Options

Command syntax

$fdfmergepro [options] input.fdf

Options — summary

Type Option Parameter Description
General -l  logFile Write progress information to a log file
-p   Provide progress messages
-r  RegNum Pass registration number to FDFMerge Pro
-v   Display version information
-h or -help   Display usage information
-w   Linearize the file upon save
-o  outFile.pdf Save output to a new file or directory
  Specific -build   Build field appearances

General options — detailed

Refer to General Options for details on the general command-line options. Refer to Applying Standard Security for more information about working with encrypted documents.

Note: You must use the -o option and specify an output file. If you don’t, you will get the error message:

Error: unable to write file

Specific options — detailed

-build — Build field appearances

Specifies FDFMerge Pro “build appearances,” that is, explicitly specify what each annotation looks like. Use this option if you are going to be using the PDF file without Adobe Acrobat or Reader. For example, viewing the PDF file on a non-Adobe viewer that cannot draw the annotation on its own, or sending the PDF straight to a printer.

Note: This option may increase processing time and output file size.

Merging FDF data and PDF templates – examples

Address labels sample

In the last chapter we created an FDF file, mylabels.fdf, using the FDFToolkit. In the following example, we will use that FDF file to create mailing address labels.

If you did not create an FDF file, the samples directory contains labels.fdf, which you can use with the following examples.

Running FDFMerge Pro

To create address labels using mylabels.fdf:

  1. Change the working directory to the FDFMerge Pro directory.
    The default location for the FDFMerge Pro samples directory in Windows is
    On other platforms, it will be wherever you installed FDFMerge Pro.
  2. Enter the following command:
    $fdfmergepro -p -o ./samples/labels/LabelsOut.pdf ./samples/labels/mylabels.fdf

    or in Windows:

    >fdfmergepro -p -o samples\labels\LabelsOut.pdf samples\labels\mylabels.fdf

    and press Return (or Enter).

  3. Open ./samples/labels/LabelsOut.pdf in Acrobat to see two pages of filled-out address labels.

Using the template

The FDF template file, template.txt, is in the samples folder. To create a simple FDF file:

  1. Duplicate the page section to create as many pages as you need.
  2. Replace /path/PDFFormName.pdf with the path and filename of the template for each page.
  3. Duplicate the fields section on each page to create as many fields as you need.
  4. Replace FieldName and FieldValue with the names and values of each field.
  5. Save As an FDF file (a text file with the .fdf extension).