Create file (from process plan)

This action is available starting with pdfToolbox 16

This action allows creating a (text-based) file from a process plan. The action type is "Create file":

The action has only 2 parameters:

  1. The name of the file that is created. By default, the file is created in the same folder as the output of the process plan. As pdfToolbox can't know which type of file you are writing, you have to specify both the name and extension of the output file.
  2. The content of the file. The example above uses plain text that includes some simple variables. Of course it's also possible to first create the whole file content in one variable using an earlier JavaScript step of the process plan, and then just to specify that single variable here.

Example

Download the example below to get a better idea of how this works.

The example runs a sub process plan to calculate the number of black-and-white and color pages in a PDF. It then outputs a JSON file with that information using the Create File action and the variables calculated by the previous step.