pdfmake 0.3.0-beta.5 → 0.3.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/LICENSE +1 -1
- package/build/pdfmake.js +64098 -63969
- package/build/pdfmake.js.map +1 -1
- package/build/pdfmake.min.js +2 -2
- package/build/pdfmake.min.js.map +1 -1
- package/build/vfs_fonts.js +5 -6
- package/fonts/Roboto/Roboto-Italic.ttf +0 -0
- package/fonts/Roboto/Roboto-Medium.ttf +0 -0
- package/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
- package/fonts/Roboto/Roboto-Regular.ttf +0 -0
- package/js/3rd-party/svg-to-pdfkit/source.js +0 -2
- package/js/3rd-party/svg-to-pdfkit.js +1 -2
- package/js/DocMeasure.js +4 -2
- package/js/DocPreprocessor.js +1 -2
- package/js/DocumentContext.js +1 -2
- package/js/ElementWriter.js +1 -2
- package/js/LayoutBuilder.js +1 -2
- package/js/Line.js +1 -2
- package/js/OutputDocument.js +11 -12
- package/js/OutputDocumentServer.js +1 -2
- package/js/PDFDocument.js +1 -2
- package/js/PageElementWriter.js +1 -2
- package/js/Printer.js +2 -2
- package/js/Renderer.js +1 -2
- package/js/SVGMeasure.js +1 -2
- package/js/StyleContextStack.js +1 -3
- package/js/TableProcessor.js +4 -2
- package/js/TextBreaker.js +1 -2
- package/js/TextDecorator.js +2 -3
- package/js/TextInlines.js +1 -2
- package/js/URLResolver.js +1 -2
- package/js/base.js +1 -2
- package/js/browser-extensions/OutputDocumentBrowser.js +1 -2
- package/js/browser-extensions/URLBrowserResolver.js +1 -2
- package/js/browser-extensions/index.js +1 -2
- package/js/columnCalculator.js +2 -3
- package/js/qrEnc.js +7 -7
- package/js/standardPageSizes.js +2 -3
- package/js/tableLayouts.js +3 -5
- package/js/virtual-fs.js +1 -2
- package/package.json +22 -21
- package/src/DocMeasure.js +3 -0
- package/src/OutputDocument.js +78 -78
- package/src/Printer.js +1 -0
- package/src/TableProcessor.js +4 -0
- package/src/TextDecorator.js +1 -1
- package/src/qrEnc.js +5 -3
package/src/Printer.js
CHANGED
|
@@ -62,6 +62,7 @@ class PdfPrinter {
|
|
|
62
62
|
userPassword: docDefinition.userPassword,
|
|
63
63
|
ownerPassword: docDefinition.ownerPassword,
|
|
64
64
|
permissions: docDefinition.permissions,
|
|
65
|
+
lang: docDefinition.language,
|
|
65
66
|
fontLayoutCache: typeof options.fontLayoutCache === 'boolean' ? options.fontLayoutCache : true,
|
|
66
67
|
bufferPages: options.bufferPages || false,
|
|
67
68
|
autoFirstPage: false,
|
package/src/TableProcessor.js
CHANGED
|
@@ -102,6 +102,10 @@ class TableProcessor {
|
|
|
102
102
|
this.cleanUpRepeatables = false;
|
|
103
103
|
|
|
104
104
|
this.headerRows = tableNode.table.headerRows || 0;
|
|
105
|
+
if (this.headerRows > tableNode.table.body.length) {
|
|
106
|
+
throw new Error(`Too few rows in the table. Property headerRows requires at least ${this.headerRows}, contains only ${tableNode.table.body.length}`);
|
|
107
|
+
}
|
|
108
|
+
|
|
105
109
|
this.rowsWithoutPageBreak = this.headerRows + (tableNode.table.keepWithHeaderRows || 0);
|
|
106
110
|
this.dontBreakRows = tableNode.table.dontBreakRows || false;
|
|
107
111
|
|
package/src/TextDecorator.js
CHANGED
|
@@ -109,7 +109,7 @@ class TextDecorator {
|
|
|
109
109
|
y += lineAscent - (ascent * 0.25);
|
|
110
110
|
break;
|
|
111
111
|
default:
|
|
112
|
-
throw new Error(`
|
|
112
|
+
throw new Error(`Unknown decoration : ${group.decoration}`);
|
|
113
113
|
}
|
|
114
114
|
this.pdfDocument.save();
|
|
115
115
|
|
package/src/qrEnc.js
CHANGED
|
@@ -748,11 +748,13 @@ function buildCanvas(data, options) {
|
|
|
748
748
|
var canvas = [];
|
|
749
749
|
var background = options.background || '#fff';
|
|
750
750
|
var foreground = options.foreground || '#000';
|
|
751
|
+
var padding = options.padding || 0;
|
|
751
752
|
//var margin = options.margin || 4;
|
|
752
753
|
var matrix = generateFrame(data, options);
|
|
753
754
|
var n = matrix.length;
|
|
754
755
|
var modSize = Math.floor(options.fit ? options.fit / n : 5);
|
|
755
|
-
var size = n * modSize;
|
|
756
|
+
var size = (n * modSize) + (modSize * padding * 2);
|
|
757
|
+
var paddingXY = modSize * padding;
|
|
756
758
|
|
|
757
759
|
canvas.push({
|
|
758
760
|
type: 'rect',
|
|
@@ -764,8 +766,8 @@ function buildCanvas(data, options) {
|
|
|
764
766
|
if (matrix[i][j]) {
|
|
765
767
|
canvas.push({
|
|
766
768
|
type: 'rect',
|
|
767
|
-
x: modSize * j,
|
|
768
|
-
y: modSize * i,
|
|
769
|
+
x: modSize * j + paddingXY,
|
|
770
|
+
y: modSize * i + paddingXY,
|
|
769
771
|
w: modSize,
|
|
770
772
|
h: modSize,
|
|
771
773
|
lineWidth: 0,
|