jsPDF HTML 插件
- Source:
Methods
(inner) html(source, optionsopt)
- Source:
使用 HTML 元素或字符串生成 PDF。
Example
var doc = new jsPDF();
doc.html(document.body, {
callback: function (doc) {
doc.save();
},
x: 10,
y: 10
});
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
source |
HTMLElement | string | HTML 元素或包含 HTML 的字符串。 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
options |
Object |
<optional> |
设置选项 Properties
|
Type Definitions
FontFace
- Source:
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
family |
string | 字体族名称。 |
|
style |
string | undefined | 字体样式,例如 'italic'。 |
|
weight |
string | number | undefined | 字体粗细,可以是字符串或数字(例如 400, 500, 600)。 |
|
stretch |
string | undefined | 字体拉伸,例如 condensed, normal, expanded。 |
|
src |
Array.<Object> | 各种格式字体可以获取的 URL 列表。 |
|
src |
string |
<optional> |
特定格式的字体 URL。 |
src |
string |
<optional> |
字体格式。 |