Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion plugins/cell.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@

jsPDFAPI.cell = function (x, y, w, h, txt, ln, align) {
var curCell = getLastCellPosition();
var pgAdded = false;

// If this is not the first cell, we must change its position
if (curCell.ln !== undefined) {
Expand All @@ -117,13 +118,14 @@
var margins = this.margins || NO_MARGINS;
if ((curCell.y + curCell.h + h + margin) >= this.internal.pageSize.height - margins.bottom) {
this.cellAddPage();
pgAdded = true;
if (this.printHeaders && this.tableHeaderRow) {
this.printHeaderRow(ln, true);
}
}
//We ignore the passed y: the lines may have diferent heights
y = (getLastCellPosition().y + getLastCellPosition().h);

if (pgAdded) y = margin + 10;
}
}

Expand Down Expand Up @@ -233,6 +235,9 @@
if(config.fontSize){
fontSize = config.fontSize;
}
if (config.css['font-size']) {
fontSize = config.css['font-size'] * 16;
}
if(config.margins){
margins = config.margins;
}
Expand Down Expand Up @@ -390,6 +395,7 @@

tableHeaderCell = this.tableHeaderRow[i];
if (new_page) {
this.margins.top = margin;
tableHeaderCell[1] = this.margins && this.margins.top || 0;
tempHeaderConf.push(tableHeaderCell);
}
Expand Down
6 changes: 4 additions & 2 deletions plugins/from_html.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,9 @@
renderer.y += 10;
renderer.pdf.table(renderer.x, renderer.y, table2json.rows, table2json.headers, {
autoSize : false,
printHeaders : true,
margins : renderer.pdf.margins_doc
printHeaders: elementHandlers.printHeaders,
margins: renderer.pdf.margins_doc,
css: GetCSS(cn)
});
renderer.y = renderer.pdf.lastCellPos.y + renderer.pdf.lastCellPos.h + 20;
} else if (cn.nodeName === "OL" || cn.nodeName === "UL") {
Expand Down Expand Up @@ -502,6 +503,7 @@
}
i++;
}
elementHandlers.outY = renderer.y;

if (isBlock) {
return renderer.setBlockBoundary(cb);
Expand Down