如何使用逻辑应用程序将文件从二进制输出保存为 pdf

how to save file as pdf from binary output using logic app

我有 HTTP body('HTTP') 的输出是 -

    {"statusCode":200,"headers":{"dataserviceversion":"2.0","sap-metadata-last-modified":"Fri, 09 Aug 2019 10:41:57 GMT",
"Cache-Control":"no-store, no-cache","Date":"Fri, 
09 Aug 2019 11:26:58 GMT","Content-Type":"application/atom+xml; type=feed; charset=utf-8","Content-Length":"1365811"},
"body":{"$content-type":"application/atom+xml; type=feed; charset=utf-8","$content":"PGZlZWQgeG1sbn

note - content-type is application/atom+xml

$content 有二进制数据,它只是 pdf 文件。

我想获取这些数据并将其转换成pdf文件

在创建我发送的 pdf 文件时进入 Sharepoint 连接器 body('HTTP')?['content'] 仍然无法创建有效的 pdf 文件。甚至只试过body('HTTP')同样的错误。

打开文件时抛出错误 -

在共享点创建文件连接器中,我正在传递二进制字符串,如 - base64ToBinary(thatBinaryValue) 但在共享点类型是

 "$content-type": "application/octet-stream",

我尝试用HTTP触发器来处理PDF,我想这是由内容表达引起的。如果我用@triggerBody()['$content']处理pdf内容,文件也打不开。

所以我将其更改为 @triggerBody() 以获取内容并且它有效,所以你的应该只是 body('HTTP')。你可以试试,希望对你有帮助。

Update: 我试过HTTP action,结果一样,是表达式问题。因此,只需更改表达式即可。