TSTool / Command / PDF
Overview
This command is under development. Functionality may be limited.
The PDF command manipulates PDF files using one of the following sub-commands
(additional functionality will be added in the future):
Merge- merge multiple PDF input files into one PDF output file
The Apache PDFBox version 3.0.6 software is used to implement the functionality. Additional PDF manipulation features may be added in the future.
Merge Files
The list of input files to merge 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 extensionpdf**/*.pdf- matches file names with extensionpdfin any folder- the returned list is sorted alphabetically before being added to the full list of files
Any file that does not end in pdf (any case) is ignored.
In the future, the option to use a table to specify file names may be added,
for example using the output from the ListFiles command.
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.
PDF Merge Command Editor (see full-size image)
Command Syntax
The command syntax is as follows:
PDF(Parameter="Value",...)
Command Parameters
| Tab | Parameter | Description | Default |
|---|---|---|---|
| All | PDFCommand |
A PDF command to execute:
|
None - must be specified. |
IfNotFound |
Indicate action if an input file is not found, one of:
|
Warn |
|
| Merge | MergeInputFiles |
The name of one or more files to append, specified as file patterns separated by commas:
Can specify using processor ${Property}. |
Specify file pattern(s) or text to append. |
MergeOutputFilerequired |
The output file that will be created. 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. |
Examples
See the automated tests.
Troubleshooting
See the main TSTool Troubleshooting documentation.
See Also
CopyFilecommandFormatFilecommandListFilescommandRemoveFilecommand