[英]how to save file as pdf from binary output using logic app
I have HTTP
output for body('HTTP') is - 我的body('HTTP')的
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
注意-内容类型为application / atom + xml
$content is having binary data which is nothing but pdf file. $ content具有二进制数据,仅是pdf文件。
I want to get this data and convert it into pdf file 我想获取此数据并将其转换为pdf文件
into sharepoint connector while create pdf file i send body('HTTP')?['content']
still unable to create a valid pdf file. 创建PDF文件时将其插入sharepoint连接器,但我发送
body('HTTP')?['content']
仍无法创建有效的PDF文件。 even tried only body('HTTP')
same error. 甚至只尝试了
body('HTTP')
相同的错误。
while opening file it throws error - 打开文件时会引发错误-
in sharepoint create file connector i'm passing that binary string like - base64ToBinary(thatBinaryValue)
but in sharepoint type is 在sharepoint创建文件连接器中,我正在传递该二进制字符串,例如
base64ToBinary(thatBinaryValue)
但在sharepoint类型中为
"$content-type": "application/octet-stream",
I tried with HTTP trigger to process PDF, and I suppose it's caused by the content expression. 我尝试使用HTTP触发器来处理PDF,我想这是由内容表达式引起的。 If I use the
@triggerBody()['$content']
to process pdf content, the file couldn't be open too. 如果我使用
@triggerBody()['$content']
处理pdf内容,则文件也无法打开。
So I change it to @triggerBody()
to get the content and it works, so yours should be just body('HTTP')
. 所以我将其更改为
@triggerBody()
以获取内容并且它可以工作,因此您的应该只是body('HTTP')
。 You could have a try, hope this could help you. 您可以尝试一下,希望对您有所帮助。
Update : I tried with HTTP action, and got the same result, it's the expression problem. 更新 :我尝试使用HTTP操作,并得到了相同的结果,这是表达问题。 So just change the expression.
因此,只需更改表达式。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.