FDFMerge and FDFMerge Lite – Options

FDFMerge and FDFMerge Lite – Options

In this chapter…

.…you will learn about the options available within FDFMerge Lite and FDFMerge. Information that is specific to FDFMerge is followed by the notation: (FDFMerge only).

FDFMerge Lite and FDFMerge Options

Refer to FDFMerge Lite – General Command-Line Options or FDFMerge – General Command-Line Options for details on the general options.

Refer to FDFMerge Lite – Applying Standard Security or FDFMerge – Applying Standard Security for more information about the security options and working with encrypted documents.

The following are examples of simple command lines for calling FDFMerge Lite or FDFMerge:

$ fdfmergeliteapp [options] -o out.pdf input.pdf input.fdf
$ fdfmergeapp [options] -o out.pdf input.pdf input.fdf

The table below shows command-line options for FDFMerge Lite and FDFMerge.

Options summary

Option Parameter Description
-x Input is an XFDF file, not an FDF file.
-s Replace all fields with stamps.
-stampnewvalues Stamp fields with new values (FDFMerge only)
-reverse Make FDF file come first followed by multiple PDF files.
-norebuild Don’t rebuild appearances.
-mergeflags Merge F and Ff flags along with the field values in the FDF
-f <FormInfo.txt> Field information file for partial field replacement (FDFMerge only).
-cmds <CommandFile.txt> Process multiple commands and files.
Compatible with -l, -p, -r, -h or -help and -n.

-x — Input is an XFDF file

Specifies that the input data file is an XFDF file, which is an XML version of an FDF file. Required if using an XFDF input file instead of an FDF file.

-s — Replace all fields with stamps (optional)

Flattens a form, changing active form fields into static text or images. For more information about how this works, see To merge and flatten, or to merge and not flatten.

-stampnewvalues — Stamp fields with new values (optional – FDFMerge only)

Partially flatten form fields passed in using FDF and XFDF files. When this feature is present on the command line, all unfilled fields will remain active.

-reverse — Make FDF file come first followed by multiple PDF input files (optional)

Processes multiple PDF forms with a single FDF file. An output directory must be used with -reverse. FDFMerge Lite and FDFMerge normally require the PDF form before the FDF file on the command line. However, when running multiple forms with the same FDF file, the FDF file must appear before the PDF form on the command line. For example, the following command:

$ fdfmergelite [options] -o ./merged -reverse fdf_filename.fdf pdf_filename1.pdf pdf_filename2.pdf...pdf_filename3.pdf
$ fdfmerge [options] -o ./merged -reverse fdf_filename.fdf pdf_filename1.pdf pdf_filename2.pdf...pdf_filename3.pdf

Merges the same form information into each PDF file, and writes the new files to the ./merged directory using the same PDF filename as the input PDF form file. Required when running multiple PDFs.

Note: FDFMerge Lite or FDFMerge will not create a directory, so be sure the directory for the output files exists.

-norebuild — Don’t rebuild appearances (optional)

Specifies that Acrobat, rather than FDFMerge Lite or FDFMerge builds the form appearances for an output PDF form. Use this option when merging text fields containing formats or calculations to have Acrobat keep the formatting.

Note: The -norebuild flag will be ignored if used with the -s flag.

-mergeflags — Merge F and Ff flags along with the field values in the FDF

Can be used to set fields to ReadOnly. For example, having the following in an FDF file will set the form field to ReadOnly when merging

/T(name) /V(John Smith) /Ff 1

-f <FormInfo.txt> — Field information file for field customization (optional) — FDFMerge only

Specifies that a FormInfo file be used for flattening, customizing form fields, or stamping them with JPEG, TIF or PDF images.

More information on merging and flattening form fields can be found below in To merge and flatten, or to merge and not flatten. For information on available parameters and how to put together a FormInfo file, see FormInfo Files.

Note: All form fields described in the FormInfo file are flattened in the output PDF document, whether or not the -s option (described below) is used.

To merge and flatten, or to merge and not flatten, and the FormInfo file — FDFMerge only

The results of using the -s option can vary if you also specify a FormInfo file. See flattening variations in the table below describes the different scenarios (see FormInfo Files).

Flattening variations

-s -f FormInfo file Result
All fields are flattened, and the original file formatting is retained.
Only those form fields specified in the FormInfo file are flattened. Fields that are not specified remain active. (FDFMerge only)
All fields are flattened and formatted according to FormInfo file specifications, if available. Fields without customization information in the FormInfo file maintain their original formatting. (FDFMerge only)

Note: See Notes on JavaScript and Formatting Fields for detailed information on formatting fields in the FDF file that will be flattened.

-cmds <CommandFile.txt> — Allows you to process a collection of files at one time

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

$ fdfmergeliteapp -p -l logfile.txt -cmds CommandFile.txt
$ fdfmergeapp -p -l logfile.txt -cmds CommandFile.txt

CommandFile.txt contains a list of commands for FDFMerge to process. An example of a CommandFile.txt file:

-p -optimize -f /appligent/fdfmerge/samples/testfiles/testfile1.txt-o /appligent/fdfmerge/samples/testfiles/outfile1.pdf/appligent/fdfmerge/samples/testfiles/testfile.pdf/appligent/fdfmerge/samples/testfiles/testfile.fdf
-p -x -o /appligent/fdfmerge/samples/testfiles/outfile2.pdf/appligent/fdfmerge/samples/testfiles/testfile.pdf/appligent/fdfmerge/samples/testfiles/testfile.xfdf
-p -w -x -f /appligent/fdfmerge/samples/healthform/healthform3.txt-o /appligent/fdfmerge/samples/healthform/outfiles3.pdf/appligent/fdfmerge/samples/healthform/healthform.pdf /appligent/fdfmerge/samples/healthform/healthform.xfdf