打印按钮在 LiveCycle Html5 表单中不起作用

Print Button not working in LiveCycle Html5 form

我有一个已转换为 Html5 格式的 pdf 格式。在转换中,我将打印按钮拖到生成此代码的表单中:

xfa.host.print(1, "0", (xfa.host.numPages -1).toString(), 0, 0, 0, 0, 0);

问题是点击后没有任何反应。当它是 PDF 表单时它确实有效。

所以 xfa.host.print() 不在 list of methods supported by HTML5 Mobile Forms 上,但是有一个解决方法。试试这个代码:

if ( xfa.host.appType == "HTML 5" )
{
    window.print();
}
else
{
    xfa.host.print(1, "0", (xfa.host.numPages -1).toString(), 0, 0, 0, 0, 0);
}