使用库 pdf.js
IRCC XFA 参考:https://www.canada.ca/content/dam/ircc/migration/ircc/english/pdf/kits/forms/imm5257b_1.pdf
在此 XFA 表单中,多个控件的 fieldid 和 dataid 值是重复的。例如。
familyname
例如:
{
"name": "textarea",
"attributes": {
"dataId": "field284442",
"fieldId": "field284442",
"class": [
"xfaTextfield"
],
"aria-label": "Question 1 Family name as shown on your passport or travel document",
"aria-required": true,
"required": true,
"tabindex": 5002,
"maxLength": 100
}
}
}
问题:如果我想用值
field284442
更新 {john}
,由于 id 重复,代码将无法工作。
pdf.annotationStorage.setValue('field284442', { value: 'John' });
你能帮我吗:
任何示例代码、解决方案链接或输入都将受到高度赞赏。
预先感谢。
您是否成功完成了pdf的填写和保存?谢