Methods
(inner) cell(x, y, width, height, text, lineNumber, align) → {jsPDF}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
x |
number | |
y |
number | |
width |
number | |
height |
number | |
text |
string | |
lineNumber |
number | lineNumber |
align |
string |
Returns:
jsPDF-instance
- Type
- jsPDF
(inner) cellAddPage()
- Source:
(inner) getTextDimensions(txt) → {Object}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
txt |
string |
Returns:
dimensions
- Type
- Object
(inner) printHeaderRow(lineNumber, new_page)
- Source:
输出存储的表头行
Parameters:
Name | Type | Description |
---|---|---|
lineNumber |
number | 要输出的行号 |
new_page |
boolean |
(inner) setHeaderFunction(func)
- Source:
Parameters:
Name | Type | Description |
---|---|---|
func |
function |
(inner) setTableHeaderRow(config)
- Source:
存储用于输出表头的配置
Parameters:
Name | Type | Description |
---|---|---|
config |
Array.<Object> | 一个包含单元格配置的数组,定义表头行:每个配置与 jsPDFAPI.cell 使用的配置匹配,但排除了 lineNumber 参数 |
(inner) table(xopt, yopt, dataopt, headersopt) → {jsPDF}
- Source:
从一组数据创建一个表格。
参数:
Name | Type | Attributes | Description |
---|---|---|---|
x |
Integer |
<optional> |
表格左上角的左位置 |
y |
Integer |
<optional> |
表格左上角的顶部位置 |
data |
Array.<Object> |
<optional> |
一个包含键值对的对象数组,对应于一行数据。 |
headers |
Array.<String> |
<optional> |
省略或 null 以自动生成表头,以性能为代价 |
config.printHeaders |
Object |
<optional> |
true 以在每页顶部打印列标题 |
config.autoSize |
Object |
<optional> |
true 以动态设置列宽度以匹配最宽的单元格值 |
config.margins |
Object |
<optional> |
左、上、下和宽的边距值 |
config.fontSize |
Object |
<optional> |
要使用的字体大小(可选) |
config.padding |
Object |
<optional> |
单元格填充(以 pt 为单位)(可选) |
config.headerBackgroundColor |
Object |
<optional> |
默认是 #c8c8c8(可选) |
config.headerTextColor |
Object |
<optional> |
默认是 #000(可选) |
config.rowStart |
Object |
<optional> |
回调函数,用于在打印每行之前处理(可选) |
config.cellStart |
Object |
<optional> |
回调函数,用于在打印每个单元格之前处理(可选) |
Returns:
jsPDF-instance
- Type
- jsPDF