Merge PDFs from Sharepoint (Dynamic Page Count)

New Here ,
Jun 01, 2021 Jun 01, 2021

Copy link to clipboard



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:

Merge Flow.png


And here is the error I get on the Merge PDFs step:



  "error": {
    "message""For application/pdf mime-type The input file appears to be corrupted and cannot be processed.; transactionId=VQTDOIyZ0GELGsBTn906mdWut90RjQ9z-PowerAutomate"
  "strict-transport-security""max-age=31536000; includeSubdomains",
  "Cache-Control""no-store, must-revalidate, no-cache",
  "Date""Tue, 01 Jun 2021 20:33:28 GMT",
  "Expires""Thu, 01 Dec 1994 16:00:00 GMT",
Status Code
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.







Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation