getMergedReport
Concatenates multiple files and returns the ID of the resulting file (saved in the file upload location).
IMPORTANT!
getMergedReport supports only .pdf and .docx files.Syntax
Copy
function getMergedReport(reports: string[], reportName: string, deleteInitialReports: boolean, addPageBetweenReports: boolean): string
| Parameter | Description |
|---|---|
reports | Array of strings containing the unique internal IDs of the merged files (real names) in the order you wish to merge them. |
reportName | Name of the resulting merged file. |
deleteInitialReports |
|
addPageBetweenReports |
|
Return Value
Returns a string containing the saved merged file's real name.
Examples
In this example:
- We merge the january_03d894e2-eb06-4641-a1e6-c711dd046e1a.pdf, february_19f5e30d-cf3c-41af-9e6b-d5024f4bd77f.pdf, and march_9ad66daa-53ff-4707-870b-d347c5e323ea.pdf files into a document called trimester1.pdf.
- After the merge, we don't delete the monthly reports (false).
- In the merged file, we insert a blank page between the monthly reports (true).
- We save the resulting file ID in a variable called trimesterReport.
var trimesterReport = getMergedReport(['january_03d894e2-eb06-4641-a1e6-c711dd046e1a.pdf', 'february_19f5e30d-cf3c-41af-9e6b-d5024f4bd77f.pdf', 'march_9ad66daa-53ff-4707-870b-d347c5e323ea.pdf'], 'trimester1', false, true);