【问题标题】:wkhtmltopdf --enable-forms attribute not displaying textbox valuewkhtmltopdf --enable-forms 属性不显示文本框值
【发布时间】:2018-07-23 11:50:20
【问题描述】:

我想将我的 HTML 转换为 pdf。我正在使用 wkhtmltopdf。

以下是HTML

<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
 <input id="text1" type="text" value="Value of the TextBox" />
</body>
</html>

下面的命令行给了我正确的输出

wkhtmltopdf.exe  "file:///D:/Default.html" "d:/test.pdf"

但我想启用表单。所以我使用 --enable-forms 属性

wkhtmltopdf.exe --enable-forms  "file:///D:/Default.html" "d:/test.pdf"

它给了我空的文本框。我想在文本框中显示文本框值。 我试过 wkhtmltopdf 0.12.4 版本。即使我遇到了同样的问题。

【问题讨论】:

    标签: html pdf pdf-generation wkhtmltopdf html-to-pdf


    【解决方案1】:

    请给出每个输入元素的唯一名称。

    从以下链接获得修复: “如果你想创建一个 PDF 表单,你的所有输入元素都必须有一个唯一的名称。” https://github.com/wkhtmltopdf/wkhtmltopdf/issues/1784

    【讨论】:

      猜你喜欢
      • 2012-09-30
      • 2012-01-01
      • 2018-01-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-01-17
      • 2019-04-12
      • 1970-01-01
      相关资源
      最近更新 更多