Constructor
Example
let pdfDoc; // PDFDoc实例
let pdfForm = await pdfDoc.loadPDFForm();
Methods
addControl()
- Description:
- 将新的表单控件添加到指定的表单域。如果表单域不存在,此函数也将添加一个表单域。(不支持签名域)。
- Deprecated:
addSignature()
- Description:
- Deprecated:
(async) createCheckbox(options) → {Promise.<Widget>}
- Description:
Parameters:
Returns:
-
Type
-
Promise.<Widget>
(async) createComboBox(options) → {Promise.<Widget>}
- Description:
Parameters:
Returns:
-
Type
-
Promise.<Widget>
(async) createDatetime(options) → {Promise.<Widget>}
- Description:
Parameters:
Returns:
-
Type
-
Promise.<Widget>
- Description:
Parameters:
Returns:
-
Type
-
Promise.<Widget>
(async) createListBox(options) → {Promise.<Widget>}
- Description:
Parameters:
Returns:
-
Type
-
Promise.<Widget>
- Description:
Parameters:
Returns:
-
Type
-
Promise.<Widget>
- Description:
Parameters:
Returns:
-
Type
-
Promise.<Widget>
(async) createSignature(options) → {Promise.<Widget>}
- Description:
Parameters:
Returns:
-
Type
-
Promise.<Widget>
(async) createTextField(options) → {Promise.<Widget>}
- Description:
Parameters:
Returns:
-
Type
-
Promise.<Widget>
- Description:
Example
let embedView; // View实例
let fileType; // 文件类型
let pdfForm = await embedView.pdfDoc.loadPDFForm();
pdfForm.exportFormToFile(fileType);
Parameters:
| Name |
Type |
Description |
fileType |
number
|
文件类型,0: FDF, 1: XFDF, 2: XML, 3: CSV, 4: TXT, 5: JSON |
Returns:
-
Type
-
Promise.<void>
(async) getField(fieldName) → {Promise.<(PDFField|undefined)>}
- Description:
Parameters:
| Name |
Type |
Description |
fieldName |
string
|
表单域名称 |
Returns:
-
Type
-
Promise.<(PDFField|undefined)>
getFieldByIndex()
- Description:
- Deprecated:
getFieldCount()
- Description:
- Deprecated:
(async) getFields() → {Promise.<Array.<PDFField>>}
- Description:
Returns:
-
Type
-
Promise.<Array.<PDFField>>
- Description:
Example
let embedView; // View实例
let file = e.target.files[0]; // <input type="file">标签选取的文件
let fileType; // 文件类型
let pdfForm = await embedView.pdfDoc.loadPDFForm();
pdfForm.importFormFromFile(file, fileType);
Parameters:
| Name |
Type |
Description |
file |
File
|
Blob
|
要导入的文件或Blob对象 |
fileType |
number
|
文件类型,0: FDF, 1: XFDF, 2: XML, 3: CSV, 4: TXT, 5: JSON |
Returns:
-
Type
-
Promise.<void>
removeField()
- Description:
- Deprecated:
Type Definitions
CreateDatetimeOptions
Properties:
| Name |
Type |
Attributes |
Description |
pageIndex |
number
|
|
页面索引,从0开始 |
pdfRect |
Rect
|
|
表单控件在PDF页面上的位置和大小 |
fieldName |
string
|
<optional>
|
可选的表单域名称,如果未提供,系统将自动生成一个唯一的名称 |
timeformat |
string
|
<optional>
|
可选的时间格式字符串,指定日期时间控件的显示格式 |
Type:
CreateImageOptions
Properties:
| Name |
Type |
Attributes |
Description |
pageIndex |
number
|
|
页面索引,从0开始 |
pdfRect |
Rect
|
|
表单控件在PDF页面上的位置和大小 |
fieldName |
string
|
<optional>
|
可选的表单域名称,如果未提供,系统将自动生成一个唯一的名称 |
imagePath |
string
|
|
图像的URL路径,用于创建图像按钮控件 |
Type:
Properties:
| Name |
Type |
Attributes |
Description |
pageIndex |
number
|
|
页面索引,从0开始 |
pdfRect |
Rect
|
|
表单控件在PDF页面上的位置和大小 |
fieldName |
string
|
<optional>
|
可选的表单域名称,如果未提供,系统将自动生成一个唯一的名称 |
Type: