Process Plan step "Add files"
The Process Plan step 'Add files' supports three different use cases:
- Merge PDF Files: Allows you to add additional pages to an existing PDF within the Process Plan workflow.
- Embed Files: Enables embedding external files into the PDF being processed (e.g., for archival workflows).
- Replace File: Replaces the current PDF with a different PDF, making it the active file in the workflow.
Erliest version with full support for the "Replace file" option is pdfToolbox 16
The Process Plan itself is configured using a script:
- After drag&dropping the step onto the canvas, click on the step
- Click the '+' button in the right side panel to start working on the configuration script
The sample script looks like below:
Example script: Add a cover page
Below is a sample script to add a cover page (1 pager) to the front of a PDF file:
const conf = {
prepend: [], //array of files to prepend to current doc
append: [] , //array of files to append to current doc
embed: [] //array of files to embed into current doc
};
const CoverPath = '/Users/admin/Downloads/callas_cover_Part1.pdf';
conf.prepend.push({
path: CoverPath,
first_page:0,
num_pages:1
});
conf;
Fancy a video about 'Add files' Process Plan step?
Replace PDF file
The replace
property can be either:
A string that specifies the full path to the document that will replace the current file.
let conf = {};
conf = {
replace: "/Users/Desktop/AddFiles/test.pdf"
};
An object that defines the full path to the replacement document and offers the option to rename the file based on the name of the replacement file.
let conf = {};
conf = {
replace:
{
path: "/Users/Desktop/AddFiles/test.pdf",
rename: true
}
};
Example: Replace current file with result of previous Process Plan step
Below is a downloadable Process Plan that replaces the current PDF file with the result file from the previous process plan step:
(erliest version with full support is pdfToolbox 16)