0

我想使用 PDF Reactor 和 MS Flow 将一个简单的 html 文件转换为 PDF。

我设置了一个在 docker 容器中运行的 PdfReactor。

有人可以帮我获得 http 发布请求的权利,让 PdfReactor 将文件转换为 pdf 吗?

我正在尝试构建的 MS Flow 的屏幕截图

PdfReactor 文档

4

2 回答 2

0

PDFreactor Web 服务的大多数 POST 方法的负载必须是 XML、JSON 或 ZIP 格式(另请参见https://www.pdfreactor.com/product/doc_html/index.html#payload)。

因此,您应该将请求的“正文”设置为 JSON,如下所示:

{
    document: "Your File Content"
}
于 2020-05-04T07:06:38.270 回答
0

新流 HTTP 请求图片

通过这个请求,我能够通过有效载荷。

“html”变量的内容将如下所示。

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Inspectionlist 0583 / 16.05.2020</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.Stil1 {
	font-size: 36px;
	font-weight: bold;
}
.Stil11 {font-size: 44px}
.Stil12 {font-size: 36px}
-->
</style>
</head>

<body>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="39%"><div align="center" class="Stil1">
      <p><span class="Stil11">I n s p e c t i o n s </span> <br>
  16.05.2020<br>
        </p>
      </div></td>
    <td width="32%"><div align="center"><span class="Stil11"><span class="Stil12">Ship-No.:</span> <span class="Stil1">0583</span></span> <br>
      </div></td>
  </tr>
</table>

<table width="100%"  border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#999999">
  <tr bgcolor="#CCCCCC">
    <th width="20" scope="col"><strong>No.</strong></th>
    <th width="70" scope="col"><strong>Start of insp. </strong></th>
    <th width="70" scope="col"><strong>End of insp. </strong></th>
    <th width="30" scope="col"><strong>Class.</strong></th>
    <th width="30" scope="col"><strong>Yard</strong></th>
    <th width="30" scope="col"><strong>Owner</strong></th>
    <th width="158" scope="col"><strong>Responsible</strong></th>
    <th width="30" scope="col"><div align="center"><strong>BGN</strong></div></th>
    <th width="481" scope="col"><strong>Description</strong></th>
    <th width="130" scope="col"><strong>Pre-Inspection Yard </strong><strong>Contractor</strong></th>
  </tr>
 <tr>
    <td width="20"><div align="center"><span class="Stil8"></span></div></td>
    <td width="70"><div align="center"><span class="Stil8"><B><FONT SIZE="6">No Inspections!<B></FONT> </span></div></td>
    <td width="70"><div align="center"><span class="Stil8"></span></div></td>
    <td width="30"><div align="center"><span class="Stil8"></span></div></td>
    <td width="30"><div align="center"><span class="Stil8"></span></div></td>
    <td width="30"><div align="center"><span class="Stil8"></span></div></td>
    <td><div align="center"><span class="Stil8"></span></div></td>
    <td width="30"><div align="center"><span class="Stil8"></span></div></td>
    <td><p align="left" class="Stil3 Stil6"><strong>No.</strong>  &nbsp;&nbsp;<strong>Location:</strong>      <br><br>
      <br></p>
          </td>
    <td><div align="center"><span class="Stil8"><br>
    </span></div>      <div align="center"></div></td>
  </tr>
</table>
<center> printed on: 15.05.2020 - 19:15 </center>
</body>
</html>

转换后,例如 acrobat 无法读取 pdf,你们知道我缺少什么吗?

于 2020-05-18T11:35:34.390 回答