Global

Type Definitions

Bookmark

Description:
  • 书签对象
Properties:
Name Type Attributes Description
id number 书签ID
deep string 书签深度
title string 书签标题
page number <optional>
书签对应的页面索引,从0开始
left number 书签对应的页面左侧位置
top number 书签对应的页面顶部位置
hasChild boolean 是否有子书签
书签对象
Type:
  • Object

CustomIconConfig

Description:
  • 自定义图标配置对象
Properties:
Name Type Attributes Default Description
annotType string 注释的类型,目前只有“stamp”可用。
category string 自定义的图标的类别。
name string 图标的名称,这是一个唯一的标识符。
width number <optional>
150 图标在PDF坐标系中的宽度。
height number <optional>
45 图标在PDF坐标系中的高度。
url string 图标文件的url。它支持HTTP、blob url和base64 url。不支持相对路径和绝对路径。
fileType string 图标的类型。它支持bmp、jpg、jpeg、png、tif、tiff、pdf。对于“tif”、“tiff”和“pdf”,还应提供具有相同前缀的svg文件url,以便在印章列表中显示。
自定义图标配置对象
Type:
  • Object

DefaultAppearance

Properties:
Name Type Attributes Description
flags number <optional>
表示默认外观的哪些属性是有意义的标志。
font Object <optional>
表示默认外观的字体。当它有意义时,它应该是一个有效的字体对象。
Properties
Name Type Attributes Description
baseName string <optional>
字体的基本名称。
familyName string <optional>
字体的族名称。
fullName string <optional>
字体的全名,它是族名称和“Bold”和“Italic”的组合。
isBold boolean <optional>
表示当前字体是否为粗体。
isEmbedded boolean <optional>
表示当前字体是否嵌入在指定的PDF文档中。
isItalic boolean <optional>
表示当前字体是否为斜体。
name string <optional>
PostScript名称。
textColor number <optional>
表示默认外观的文本颜色。
textSize number <optional>
表示默认外观的文本大小。
Type:
  • Object

EventNames

Description:
  • 事件名称,可选值如下:
    File_Opened:在文档被显示后触发。 参数:pdfDoc
    Viewer_Zoomed:在页面缩放完成后触发。 参数:newScale, oldScale
    Viewmode_Changed:改变视图模式后触发。 参数:newViewModeType, oldViewModeType
    Text_Selected:在选择文本后触发。 参数:textContent
    PageNum_Changed:在当前页面号改变后触发。 参数:newPageNumber
    Viewer_Rotated:在页面试图旋转后触发。 参数:newRotationDegree, originRotationDegree
    Annotation_Clicked:当注释被点击触发。 参数:Annot
    Annotation_Updated:当注释被更新触发。 参数:Array.<Annot>
    Annotation_Added:当新注释被添加时触发。 参数:Array.<Annot>
    Annotation_Deleted:当注释被删除时触发。 参数:Array.<Annot>
    Annotation_Activated:当注释被选中时触发。 参数:Annot
    Annotation_Unactivated:当注释被取消选中时触发。 参数:Annot
事件名称,可选值如下:
File_Opened:在文档被显示后触发。 参数:pdfDoc
Viewer_Zoomed:在页面缩放完成后触发。 参数:newScale, oldScale
Viewmode_Changed:改变视图模式后触发。 参数:newViewModeType, oldViewModeType
Text_Selected:在选择文本后触发。 参数:textContent
PageNum_Changed:在当前页面号改变后触发。 参数:newPageNumber
Viewer_Rotated:在页面试图旋转后触发。 参数:newRotationDegree, originRotationDegree
Annotation_Clicked:当注释被点击触发。 参数:Annot
Annotation_Updated:当注释被更新触发。 参数:Array.<Annot>
Annotation_Added:当新注释被添加时触发。 参数:Array.<Annot>
Annotation_Deleted:当注释被删除时触发。 参数:Array.<Annot>
Annotation_Activated:当注释被选中时触发。 参数:Annot
Annotation_Unactivated:当注释被取消选中时触发。 参数:Annot
Type:
  • string

FieldFlagOptions

Description:
  • 表单域标志选项
Properties:
Name Type Description
buttonNoToggleToOff boolean (仅适用于单选按钮) 如果设置为 true,则始终必须选择一个单选按钮;点击当前选中的按钮无效。如果设置为 false,点击选中的按钮会取消选择,导致没有按钮被选中。
buttonRadiosInUnison boolean (仅适用于单选按钮) 如果设置为 true,则在单选按钮字段中使用相同“开启”状态值的一组单选按钮将同步开启和关闭;即如果一个被选中,它们都会被选中。如果设置为 false,按钮是互斥的。
choiceMultiSelect boolean (仅适用于列表框) 如果设置为 true,可以同时选择多个项目;如果设置为 false,一次最多只能选择一个项目。
comboEdit boolean (仅适用于组合框) 如果设置为 true,组合框包含一个带有下拉列表的可编辑文本控件;如果设置为 false,则仅包含一个下拉列表。
commitOnSelChange boolean (仅适用于选择字段) 如果设置为 true,一旦使用指点设备进行选择,新值即被提交;如果设置为 false,直到用户退出字段后,新值才被提交。
hidden boolean 指示字段是否隐藏。
noExport boolean 指示字段是否可以通过提交表单操作导出。
readonly boolean 如果设置为 true,用户不能更改字段的值。任何相关的 widget 注释将不会与用户交互;即,它们不会响应鼠标点击或根据鼠标移动改变其外观。此标志对于其值是计算得出或从数据库导入的字段很有用。
required boolean 如果设置为 true,在通过提交表单操作导出时,字段必须有一个值。
textComb boolean (仅适用于文本字段) 如果设置为 true,则使用梳状布局。字段自动被划分为与字段文本的最大长度相等数量的均匀间隔位置或“梳子”,并且文本被布局到这些梳子中。
textDoNotScroll boolean (仅适用于文本字段) 如果设置为 true,字段不会滚动(单行字段水平滚动,多行字段垂直滚动)以容纳比其注释矩形内更多的文本。一旦字段满了,就不接受更多的文本。
textDoNotSpellCheck boolean (仅适用于文本字段) 如果设置为 true,输入到字段中的文本不会进行拼写检查。
textMultiline boolean (仅适用于文本字段) 如果设置为 true,文本字段可以包含多行文本;如果设置为 false,字段的文本限制为单行。
textPassword boolean (仅适用于文本字段) 如果设置为 true,该字段用于输入不应以可见形式回显到屏幕的安全密码。从键盘输入的字符应以某种不可读形式回显,例如星号或圆点字符。
表单域标志选项
Type:
  • Object

FontMap

Description:
  • 字体映射对象
Properties:
Name Type Description
nameMatches Array.<(string|RegExp)> 与文字名称匹配的字符串或正则表达式。可以是空数组或未设置。
name string 字体名称。
glyphs Array.<Object> 字体配置数组
Properties
Name Type Attributes Default Description
bold number 字体权重,可选值如下:
1. -1: 匹配任意字宽。
2. 100: 轻薄。
3. 200: 超亮。
4. 300: 亮。
5. 400: 常规(正常)。
6. 500: 中等。
7. 600: 半粗体。
8. 700: 粗体。
9. 800: 加粗。
10. 900: 重或黑。
flags number 字体样式。请参考 Constants.Font_Styles 中的值
url string 字体资源的URL。
isBrotli boolean <optional>
false 字体资源需要由brotli解密。
charsets Array.<number> 字体的字符集。请参考 Constants.Font_CharsetConstants.Font_CIDCharset 中的值
字体映射对象
Type:
  • Object

Rect

Properties:
Name Type Description
left number
top number
right number
bottom number
Type:
  • Object

ToolbarButtonOptions

Description:
  • 自定义工具栏按钮配置对象
Properties:
Name Type Attributes Default Description
position string 按钮位置,支持的值为:'left'、'right'。
type string 按钮类型,支持的值为:'button'。
icon string 按钮图标的URL。
tooltip string <optional>
按钮提示文本。
onClick function 按钮点击事件。
active boolean <optional>
false 按钮是否处于激活状态。
disabled boolean <optional>
false 按钮是否禁用。
自定义工具栏按钮配置对象
Type:
  • Object

WatermarkConfig

Description:
  • 水印配置对象
Properties:
Name Type Attributes Default Description
type string 指定水印的类型。可选值如下:
1. "text" 表示文本类型水印。
2. "image" 表示图像类型水印。
content string 指定水印的内容。可选值如下:
1. 文本类型:文本类型水印字符串。
2. 图像类型:图像的 DataURL。
pageStart number <optional>
起始页码索引。有效范围:从 0 到 (pageCount - 1)。
pageEnd number <optional>
结束页码索引。有效范围:从 0 到 (pageCount - 1)。
isMultiline boolean <optional>
false 是否支持多行水印平铺。如果 'type' 为图像,较大的图像需要压缩,可能会导致失真。
rowSpace number <optional>
0 多行水印的行间距。单位为点。仅在 "isMultiline" 为 true 时生效。
columnSpace number <optional>
0 多行水印的列间距。单位为点。仅在 "isMultiline" 为 true 时生效。
watermarkSettings Object <optional>
水印相关配置对象
Properties
Name Type Attributes Default Description
position string <optional>
Center 水印位置。可选值如下:
1. "TopLeft": 位置:左上角。
2. "TopCenter": 位置:顶部中心。
3. "TopRight": 位置:右上角。
4. "CenterLeft": 位置:中间左侧。
5. "Center": 位置:中心。
6. "CenterRight": 位置:中间右侧。
7. "BottomLeft": 位置:左下角。
8. "BottomCenter": 位置:底部中心。
9. "BottomRight": 位置:右下角。
注意:当 "isMultiline" 为 false 时,此属性生效。
offsetX number <optional>
0 水平偏移量。仅在 "isMultiline" 为 false 时生效。
offsetY number <optional>
0 垂直偏移量。仅在 "isMultiline" 为 false 时生效。
scaleX number <optional>
1 水印图像的水平缩放系数。此参数影响水印的水平缩放,不影响行间距。
scaleY number <optional>
1 水印图像的垂直缩放系数。此参数影响水印的垂直缩放,不影响列间距。
rotation number <optional>
45 旋转角度,单位为度。
opacity number <optional>
100 透明度,单位为百分比。有效范围:从 0 到 100。0 表示完全透明,100 表示完全不透明。
watermarkTextProperties Object <optional>
文本水印的独特配置对象
Properties
Name Type Attributes Default Description
font string <optional>
'Microsoft Yahei' 字体名称。应为 CSS 字体。
fontSize number <optional>
20 字体大小。
color string <optional>
#000000 字体颜色。
fontStyle string <optional>
normal 字体样式。
1. "normal": 正常字体样式。
2. "underline": 带下划线的字体样式。
lineSpace number <optional>
10 行间距。
alignment string <optional>
center 对齐方式。
1. "left": 左对齐。
2. "center": 居中对齐。
3. "right": 右对齐。
水印配置对象
Type:
  • Object