Skip to content

Commit

Permalink
fix(table): dontBreakRows not fitting on single page bpampuch#1159
Browse files Browse the repository at this point in the history
  • Loading branch information
Dario Vogogna committed Feb 3, 2021
1 parent 800aae3 commit 7196db0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/elementWriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ ElementWriter.prototype.addFragment = function (block, useBlockXOffset, useBlock
*/
ElementWriter.prototype.pushContext = function (contextOrWidth, height) {
if (contextOrWidth === undefined) {
height = this.context.getCurrentPage().height - this.context.pageMargins.top - this.context.pageMargins.bottom;
height = (this.context.getCurrentPage().height || this.context.getCurrentPage().pageSize.height) - this.context.pageMargins.top - this.context.pageMargins.bottom;
contextOrWidth = this.context.availableWidth;
}

Expand Down
5 changes: 2 additions & 3 deletions src/pageElementWriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,8 @@ PageElementWriter.prototype.commitUnbreakableBlock = function (forcedX, forcedY)
this.writer.popContext();

var nbPages = unbreakableContext.pages.length;
if (nbPages > 0) {
// no support for multi-page unbreakableBlocks
var fragment = unbreakableContext.pages[0];
for (let currentPage = 0; currentPage < nbPages; currentPage++) {
var fragment = unbreakableContext.pages[currentPage];
fragment.xOffset = forcedX;
fragment.yOffset = forcedY;

Expand Down

0 comments on commit 7196db0

Please sign in to comment.