Skip to content

Commit

Permalink
0.1.39
Browse files Browse the repository at this point in the history
  • Loading branch information
liborm85 committed Nov 10, 2018
1 parent 54cff13 commit 3da11bd
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 20 deletions.
40 changes: 27 additions & 13 deletions build/pdfmake.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! pdfmake v0.1.38, @license MIT, @link http://pdfmake.org */
/*! pdfmake v0.1.39, @license MIT, @link http://pdfmake.org */
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
Expand Down Expand Up @@ -7397,24 +7397,24 @@ function measure(fontProvider, textArray, styleContextStack) {
var linkToPage = getStyleProperty(item, styleContextStack, 'linkToPage', null);
var noWrap = getStyleProperty(item, styleContextStack, 'noWrap', null);
var preserveLeadingSpaces = getStyleProperty(item, styleContextStack, 'preserveLeadingSpaces', false);
var preserveTrailingSpaces = getStyleProperty(item, styleContextStack, 'preserveTrailingSpaces', false);

var font = fontProvider.provideFont(fontName, bold, italics);

item.width = widthOfString(item.text, font, fontSize, characterSpacing, fontFeatures);
item.height = font.lineHeight(fontSize) * lineHeight;

var leadingSpaces = item.text.match(LEADING);

if (!item.leadingCut) {
item.leadingCut = 0;
}

if (leadingSpaces && !preserveLeadingSpaces) {
var leadingSpaces;
if (!preserveLeadingSpaces && (leadingSpaces = item.text.match(LEADING))) {
item.leadingCut += widthOfString(leadingSpaces[0], font, fontSize, characterSpacing, fontFeatures);
}

var trailingSpaces = item.text.match(TRAILING);
if (trailingSpaces) {
var trailingSpaces;
if (!preserveTrailingSpaces && (trailingSpaces = item.text.match(TRAILING))) {
item.trailingCut = widthOfString(trailingSpaces[0], font, fontSize, characterSpacing, fontFeatures);
} else {
item.trailingCut = 0;
Expand Down Expand Up @@ -13800,6 +13800,7 @@ function renderVector(vector, pdfKitDoc) {
}

function renderImage(image, x, y, pdfKitDoc) {
pdfKitDoc.opacity(image.opacity || 1);
pdfKitDoc.image(image.image, image.x, image.y, {width: image._width, height: image._height});
if (image.link) {
pdfKitDoc.link(image.x, image.y, image._width, image._height, image.link);
Expand Down Expand Up @@ -48140,6 +48141,12 @@ DocMeasure.prototype.measureTable = function (node) {
vLineColor: function (i, node) {
return 'black';
},
hLineStyle: function (i, node) {
return null;
},
vLineStyle: function (i, node) {
return null;
},
paddingLeft: function (i, node) {
return 4;
},
Expand Down Expand Up @@ -49198,7 +49205,7 @@ PageElementWriter.prototype.moveToNextPage = function (pageOrientation) {
this.writer.tracker.emit('pageChanged', {
prevPage: nextPage.prevPage,
prevY: nextPage.prevY,
y: nextPage.y
y: this.writer.context.y
});
};

Expand Down Expand Up @@ -49754,6 +49761,12 @@ TableProcessor.prototype.beginRow = function (rowIndex, writer) {
TableProcessor.prototype.drawHorizontalLine = function (lineIndex, writer, overrideY) {
var lineWidth = this.layout.hLineWidth(lineIndex, this.tableNode);
if (lineWidth) {
var style = this.layout.hLineStyle(lineIndex, this.tableNode);
var dash;
if (style && style.dash) {
dash = style.dash;
}

var offset = lineWidth / 2;
var currentLine = null;
var body = this.tableNode.table.body;
Expand Down Expand Up @@ -49801,6 +49814,7 @@ TableProcessor.prototype.drawHorizontalLine = function (lineIndex, writer, overr
y1: y,
y2: y,
lineWidth: lineWidth,
dash: dash,
lineColor: isFunction(this.layout.hLineColor) ? this.layout.hLineColor(lineIndex, this.tableNode) : this.layout.hLineColor
}, false, overrideY);
currentLine = null;
Expand All @@ -49817,21 +49831,26 @@ TableProcessor.prototype.drawVerticalLine = function (x, y0, y1, vLineIndex, wri
if (width === 0) {
return;
}
var style = this.layout.vLineStyle(vLineIndex, this.tableNode);
var dash;
if (style && style.dash) {
dash = style.dash;
}
writer.addVector({
type: 'line',
x1: x + width / 2,
x2: x + width / 2,
y1: y0,
y2: y1,
lineWidth: width,
dash: dash,
lineColor: isFunction(this.layout.vLineColor) ? this.layout.vLineColor(vLineIndex, this.tableNode) : this.layout.vLineColor
}, false, true);
};

TableProcessor.prototype.endTable = function (writer) {
if (this.cleanUpRepeatables) {
writer.popFromRepeatables();
this.headerRepeatableHeight = null;
}
};

Expand Down Expand Up @@ -49863,10 +49882,6 @@ TableProcessor.prototype.endRow = function (rowIndex, writer, pageBreaks) {
ys[ys.length - 1].y1 = pageBreak.prevY;

ys.push({y0: pageBreak.y, page: pageBreak.prevPage + 1});

if (this.headerRepeatableHeight) {
ys[ys.length - 1].y0 += this.headerRepeatableHeight;
}
}
}

Expand Down Expand Up @@ -49983,7 +49998,6 @@ TableProcessor.prototype.endRow = function (rowIndex, writer, pageBreaks) {
}

if (this.headerRepeatable && (rowIndex === (this.rowsWithoutPageBreak - 1) || rowIndex === this.tableNode.table.body.length - 1)) {
this.headerRepeatableHeight = this.headerRepeatable.height;
writer.commitUnbreakableBlock();
writer.pushToRepeatables(this.headerRepeatable);
this.cleanUpRepeatables = true;
Expand Down
2 changes: 1 addition & 1 deletion build/pdfmake.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 3da11bd

Please sign in to comment.