【发布时间】:2019-05-02 01:17:31
【问题描述】:
我正在尝试将 RadioButton 添加到我使用 jsPDF 生成的 PDF 中。我从jsPDF examples page 上的 AcroForms 示例中获取了以下代码:
var radioGroup = new RadioButton();
radioGroup.value = "Test";
radioGroup.Subtype = "Form";
this.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(AcroForm.Appearance.RadioButton.Cross);
在我的项目中,我在运行时第三行代码中收到此错误,其中 RadioButton SubType 属性设置为“Form”:
TypeError: 无法设置只有 getter 的 [object Object] 的属性子类型
当我单步执行示例代码(它没有给我那个错误)时,似乎该属性甚至没有被设置,它在分配之前和之后都是空的。这个属性是做什么的?我没有看到任何关于它的信息in the docs。我的广播组需要它才能正常工作吗?如果是,我该如何设置?
【问题讨论】:
标签: jspdf