Prerequisites
- Access Permissions: Ensure that you have the necessary permissions to use the Documents Plugin. The user account used for these operations should have the required access rights.
-
Kafka Configuration: Verify that the Kafka messaging system is properly configured and accessible. The Documents Plugin relies on Kafka for communication between nodes.
- Kafka Topics: Familiarize yourself with the Kafka topics used for these operations (later in this section)
- Before initiating the combining process, ensure you have the unique IDs of all files you want to combine in the storage solution. This ensures that the combination is performed on already uploaded files.
Ensure that all files to be combined are PDF documents. The combine operation merges multiple PDF files into a single PDF.
- Extract the file ID from a Response Message of an upload file request. For more details, refer to the upload process documentation.
- Extract the file ID from a Response Message of a generate from template request. For more details, refer to the document generation reply documentation.
In the following example, we will combine two documents using their File 2:
fileId values obtained from previous upload operations.File 1:Configuring the combining process
To create a process that combines multiple files into a single document, follow these steps:- Create a process that includes a Send Message Task (Kafka) node and a Receive Message Task (Kafka) node:
- Use the Send Message Task node to send the combine request.
- Use the Receive Message Task node to receive the combine reply.
- Configure the first node (Send Message Task) by adding a Kafka Send Action.
- Specify the Kafka topic where you want to send the combine request.
- Fill in the body of the message request.
Message request example
- combineFiles: An array of combine operations. Each operation creates one combined document.
- documentType: The document type to assign to the combined file.
- customId: The unique identifier for the combined document (it could be for example the ID of a client or process instance).
- files: An array of files to include in the combined document:
- fileId: The unique identifier of the file to include.
- startPage: Starting page number (0-indexed). Use
0for the first page. - endPage: Ending page number (0-indexed). Use
0to include only the first page, or specify a higher number to include a range. - order: The order in which files should be combined. Files are merged in ascending order based on this value.
- shouldOverride: A boolean value indicating whether to override an existing document if one with the same name already exists.
You can combine specific page ranges from different documents. For example, you could take pages 1-3 from document A and pages 5-10 from document B.
- Configure the second node (Receive Message Task) by adding a Data stream topic:
The response will be sent to the
..out Kafka topic configured for file combination.Receiving the reply
The following values are expected in the reply body:- customId: The unique identifier for your document (matching the name of the folder in the storage solution where the document is uploaded).
- fileId: The ID of the newly created combined file.
- documentType: The document type.
- documentLabel: The document label (if available).
- minioPath: The storage path for the combined document.
- downloadPath: The download path for the combined document.
- noOfPages: The total number of pages in the combined document.
- error: Any error message in case of an error during the combining process.
Message response example
Note that the actual values in the response will depend on the specific combine request and the documents being combined.

