用jsPDF生成pdf,无法在Chrome中取消选择AcroformRadioButton

问题描述 投票:0回答:1

我正在使用jsPDF在nodejs中生成pdf文档。我按照此处提供的 Acroforms 示例创建了 RadioButton (http://raw.githack.com/MrRio/jsPDF/master/index.html#)。当我在 Chrome、Safari 等浏览器中打开单选按钮时,我能够关闭它。但在 Acrobat 中打开时不起作用。知道为什么吗?如何在 Acrobat 等 pdf 阅读器中关闭单选按钮?

遵循 jsPDF 提供的示例代码。期望能够关闭单选按钮,但在 Acrobat 中打开时它不起作用。

  var { RadioButton, Appearance } = jsPDF.AcroForm;

  doc.text("RadioGroup:", 50, 165);
  var radioGroup = new RadioButton();
  radioGroup.value = "Test";
  radioGroup.Subtype = "Form";

  doc.addField(radioGroup);

  var radioButton1 = radioGroup.createOption("Test");
  radioButton1.Rect = [50, 170, 30, 10];
  radioButton1.AS = "/Test";

  var radioButton2 = radioGroup.createOption("Test2");
  radioButton2.Rect = [50, 180, 30, 10];

  var radioButton3 = radioGroup.createOption("Test3");
  radioButton3.Rect = [50, 190, 20, 10];

  radioGroup.setAppearance(Appearance.RadioButton.Cross);
};
javascript node.js jspdf
1个回答
0
投票

如上所述,我们可以使用在线采样器进行现场“小提琴”

如果行动明确,请从 3 个方框中选择任意一个(就像“无线电组”一样) 无线电组的设计是这样的,可以选择任何一个,但不能选择其他

这与 Acrobat Reader 中的设计完全一致。或 MsEdge 或大多数 PDF 查看器。

© www.soinside.com 2019 - 2024. All rights reserved.