NewFormField
表单字段
描述
向所选页面添加新表单字段
对于 Text、Pushbutton、Checkbox、Choice 和 Signature 字段,字段还会作为 Widget 注释附加到当前页面,并获得注释 /P 页面引用。由于注释 /P 是 PDF 1.3 条目,在 PDF 1.2 文档中创建这些字段会自动选择 PDF 1.3。当生成的 AcroForm 签名标志要求时,Signature 字段仍可能需要 PDF 1.5
语法
Delphi
Function TPDFlib.NewFormField(Const Title: WideString; FieldType: Integer): Integer;
ActiveX
Function PDFlib::NewFormField(Title As String, FieldType As Long) As Long
DLL
int DLNewFormField(int InstanceID, const wchar_t * Title, int FieldType);
参数
| Title | 新表单字段的标题。标题不能包含句点 "." 字符 |
|---|---|
| FieldType | 要创建的字段类型:1 = 文本 2 = 按钮 3 = 复选框 4 = 单选按钮 5 = 选择框 6 = 签名 7 = 父字段 |
返回值
| 0 | 无法创建新表单字段 |
|---|---|
| Non-zero | 表单字段已成功创建,这是新字段的索引 |