Participant
June 1, 2021
Question
Merge PDFs from Sharepoint (Dynamic Page Count)
- June 1, 2021
- 1 reply
- 937 views
Hello,
I have a Sharepoint folder with several PDF files within. I would like to collect the file content from each of those files, create an array variable with the merged file content, and then pass that variable into the Adobe Merge PDFs array input.
I have tried appending the file content in several ways but keep running into an error where 'the input file appears to be corrupted'.
Here is the flow:

And here is the error I get on the Merge PDFs step:
Body
{
"error": {
"code": "OperationException",
"message": "For application/pdf mime-type The input file appears to be corrupted and cannot be processed.; transactionId=VQTDOIyZ0GELGsBTn906mdWut90RjQ9z-PowerAutomate"
}
}
Header
{
"Transfer-Encoding": "chunked",
"x-request-id": "Y9eiSoQ79xzw8YXf3r1QWkptSGVuFD2q",
"pragma": "no-cache",
"x-content-type-options": "nosniff",
"strict-transport-security": "max-age=31536000; includeSubdomains",
"x-robots-tag": "noindex,nofollow",
"vary": "accept-encoding",
"Timing-Allow-Origin": "*",
"x-ms-apihub-cached-response": "true",
"Cache-Control": "no-store, must-revalidate, no-cache",
"Date": "Tue, 01 Jun 2021 20:33:28 GMT",
"Content-Type": "application/json",
"Expires": "Thu, 01 Dec 1994 16:00:00 GMT",
"Content-Length": "232"
}
Status Code
400
I am able to successfully merge these files when I individually retrieve the file contents and use the detail inputs instead of array inputs.
Below is the beginning of one of the inputs. I believe the issue is in the bolded text, but I don't know how to append file content to my array variable without it as it has to be a valid JSON. I've attached the entire inputs for both a successful run (using detail input) and failure (using array input) for reference. It looks to me like that bolded part is the only difference.
{"host":{"apiId":"subscriptions/34eedfbf-3e33-475d-b510-23537fba3dc9/providers/Microsoft.Web/locations/canadacentral/runtimes/Canada-001/apis/adobepdftools","connectionReferenceName":"shared_adobepdftools","operationId":"CombinePDF"},"parameters":{"Files Array/outputFileName":"Package.pdf","Files Array/files":[{"$content-type":"application/pdf","$content":{"$content-type":"application/pdf","$content":"JVBERi0xLjcNCiW1tbW1DQoxIDAgb2JqDQo8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFIvTGFuZyhlbi1VUykgL1N0cnVjdFRyZWVSb290IDE0IDAgUi9NYXJrSW5mbzw8L01hcmtlZCB0cnVlPj4vTWV0YWRhdGEgMTQ1IDAgUi9WaWV3ZXJQcmVmZXJlbmNlcyAxN
Any help would be greatly appreciated.
