Skip to content

TSTool / Command / PDFMerge


Overview

This command is under development. Functionality may be limited.

The PDFMerge command merges multiple PDF files into one output file.

The Apache PDFBox version 3.0.3 software is used to implement the functionality. Additional PDF manipulation features may be added in the future.

The list of input files can be specified using a single pattern or a comma-separated list of patterns, each of which can be specified as:

  • path:
    • absolute path
    • a path relative to the command file folder
  • wildcards:
    • literal path (no wildcards) that exactly matches a file
    • wildcards to match one or more files (see Java PathMatcher):
      • * - match one or more characters at a folder level
      • *.pdf - matches file names with extension pdf
      • **/*.pdf - matches file names with extension pdf in any folder

Command Editor

The command is available in the following TSTool menu:

  • Commands / General - File Handling

The following dialog is used to edit the command and illustrates the command syntax.

PDFMerge command editor

PDFMerge Command Editor (see full-size image)

Command Syntax

The command syntax is as follows:

PDFMerge(Parameter="Value",...)

Command Parameters

Parameter                           Description Default          
InputFiles The name of one or more files to append, specified as file patterns separated by commas:
  • No * in filename – match one file
  • *– match all files in input directory (working directory by default).
  • *.pdf – match all files with extension

Can specify using processor ${Property}.
Specify file pattern(s) or text to append.
OutputFile
required
The output file that will be created from input. The file is created if it does not exist. Use the RemoveFile command to remove the old file. Can specify using processor ${Property}. None – must be specified.
IfNotFound Indicate action if the file is not found, one of:
  • Ignore – ignore the missing file (do not warn).
  • Warn – generate a warning (use this if the file truly is expected and a missing file is a cause for concern).
  • Fail – generate a failure (use this if the file truly is expected and a missing file is a cause for concern).
Warn

Examples

See the automated tests.

Troubleshooting

See the main TSTool Troubleshooting documentation.

See Also