mergeDocuments
Concatenates multiple PDF files into a single one and saves it to the file upload location.
Syntax
function mergeDocuments(filesToMerge: string[], destinationName: string, deleteFilesAfterMerge:boolean): string
| Parameter | Description |
|---|---|
filesToMerge
|
Array of strings containing the unique internal IDs of the merged PDF files (real names) in the order you wish to merge them. |
destinationName
|
File name of the saved .pdf file. |
deleteFilesAfterMerge
|
|
Return Value
Returns a string containing the saved PDF's real name.
Examples
In this example:
- We merge the following files: cover_3f62bcc9-2552-47d4-a649-4da55b8aa8ac.pdf, contents_4f2fed83-ea10-403c-889f-88b4cc25d585.pdf, and appendix_5eeb98d7-b636-4056-b399-81977e82f715.pdf into a single file called contract.pdf.
- We keep the original files after the merge (false).
- We save the real name of the new PDF file in a variable called message.
- We display the message variable on screen. For details on how to display messages, see setMessage.
message = mergeDocuments(['cover_3f62bcc9-2552-47d4-a649-4da55b8aa8ac.pdf' ,'contents_4f2fed83-ea10-403c-889f-88b4cc25d585.pdf', 'appendix_5eeb98d7-b636-4056-b399-81977e82f715.pdf'], 'contract', false); setMessage(message);