jsPDF 注释插件
PDF 文档中有多种类型的注释。注释被放置在页面的特定位置,它们并不"附加"到某个对象上。
当前插件支持以下功能:
当跳转目标是页码或命名目标时,还可以指定目标放大倍数(见下文文档) (在 options 中设置 magFactor)。XYZ 是默认值。
支持链接、文本、弹出框和自由文本注释。
PDF 规范中尚未实现的功能:
- Source:
Methods
(inner) createAnnotation(options)
- Source:
Parameters:
Name | Type | Description |
---|---|---|
options |
Object |
(inner) getTextWidth(text) → {number}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
text |
string |
Returns:
txtWidth
- Type
- number
(inner) link(x, y, w, h, options)
- Source:
创建一个链接
有效的选项
如果指定了 pageNumber,还可以指定 top 和 zoom
Parameters:
Name | Type | Description |
---|---|---|
x |
number | |
y |
number | |
w |
number | |
h |
number | |
options |
Object |
(inner) textWithLink(text, x, y, options) → {number}
- Source:
目前仅支持单行文本。
返回文本/链接的宽度
参数:
Name | Type | Description |
---|---|---|
text |
string | |
x |
number | |
y |
number | |
options |
Object |
Returns:
width 文本/链接的宽度
- Type
- number