Merge PDFs in Logic app returns "The underlying connection was closed: An unexpected error occurred

New Here ,
Nov 04, 2021 Nov 04, 2021

Copy link to clipboard

Copied

Hi,

I have created a Logic App in Azure that collects PDFs in a array and will use "Merge PDFs"-action:

NOSYS5EAC_0-1636029029602.png

Below is some of the input that is sent to the "Merge PDFs"-action:

"body": {
		"files": [
			{
				"$content": "JVBERi0xLjYNJeLjz9MNCjMxMyAwIG9iag08PC9MaW5lYXJpemVkIDEvTCAxNzQwMzMvTyAzMTUvRSAxNTk1MDMvTiAyL1QgMTczNjY3L0ggWyA1MjMgMjM5XT4+DWVuZG9iag0gICAgICAgICAgICA..",
				"$content-type": "application/pdf"
			},
			{
				"$content-type": "application/pdf",
				"$content": "JVBERi0xLjcNCiW1tbW1DQoxIDAgb2JqDQo8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFIvTGFuZyhlbi1VUykgL1N0cnVjdFRyZWVSb290IDIzIDAgUi9NYXJrSW5mbzw8L01hcmtlZCB0cnVlPj4.."
			}
		],
		"outputFileName": "Dummy.pdf"
	}

I have also tried to create another logic app that retrieves PDF-content from to SharePoint-files, append them to an array and then run "Merge PDFs". Same error here:

NOSYS5EAC_1-1636029240715.png


The "Generate document from Word template" and "Convert Word to PDF" works fine:

NOSYS5EAC_2-1636029308038.png

 

TOPICS
Document Generation API , Power Automate

Views

278

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Dec 21, 2021 Dec 21, 2021

Copy link to clipboard

Copied

Hi @NOSYS5EAC ,

 

I was looking into this and I am finding some interesting parts about the difference between Generate document from Word template and the Merge PDF action.

 

To test, I was using a OneDrive for Business step like this:

BenVanderberg_0-1640120538662.png

 

If you look at the Generate document from Word template and you use Dynamic content to insert the file content from OneDrive, it provides this in the code:

BenVanderberg_1-1640120582539.png

 

However, if you look at the Merge PDF code and you insert the variables, the code looks like this:

BenVanderberg_2-1640120622621.png

 

So basically what that tells me is that the Generate Document step accepts the $content and $content-type object, however Merge PDF is looking for a base64 version of the body.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 01, 2022 Feb 01, 2022

Copy link to clipboard

Copied

MSFlowAdobe.png

 

I am getting the same error on MS PowerAutomate

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 10, 2022 Feb 10, 2022

Copy link to clipboard

Copied

LATEST

I have finally understood what you meant
you have to get the file content, compose it to base64, append to array and then merge the array

Likes

Translate

Translate

Report

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