pdfmake 0.1.72 → 0.2.3
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 +26 -0
- package/README.md +3 -3
- package/build/pdfmake.js +67218 -65325
- package/build/pdfmake.js.map +1 -1
- package/build/pdfmake.min.js +2 -2
- package/build/pdfmake.min.js.map +1 -1
- package/package.json +35 -24
- package/src/3rd-party/svg-to-pdfkit/LICENSE +9 -0
- package/src/3rd-party/svg-to-pdfkit/source.js +2552 -0
- package/src/3rd-party/svg-to-pdfkit.js +3 -0
- package/src/browser-extensions/pdfMake.js +8 -3
- package/src/helpers.js +14 -1
- package/src/pdfKitEngine.js +1 -1
- package/src/printer.js +705 -685
- package/src/svgMeasure.js +1 -1
- package/src/tableProcessor.js +31 -12
- package/src/textDecorator.js +8 -2
- package/src/textTools.js +1 -1
|
@@ -24,10 +24,15 @@ function Document(docDefinition, tableLayouts, fonts, vfs) {
|
|
|
24
24
|
|
|
25
25
|
function canCreatePdf() {
|
|
26
26
|
// Ensure the browser provides the level of support needed
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
try {
|
|
28
|
+
var arr = new Uint8Array(1)
|
|
29
|
+
var proto = { foo: function () { return 42 } }
|
|
30
|
+
Object.setPrototypeOf(proto, Uint8Array.prototype)
|
|
31
|
+
Object.setPrototypeOf(arr, proto)
|
|
32
|
+
return arr.foo() === 42
|
|
33
|
+
} catch (e) {
|
|
34
|
+
return false
|
|
29
35
|
}
|
|
30
|
-
return true;
|
|
31
36
|
}
|
|
32
37
|
|
|
33
38
|
Document.prototype._createDoc = function (options, cb) {
|
package/src/helpers.js
CHANGED
|
@@ -97,6 +97,17 @@ function getNodeId(node) {
|
|
|
97
97
|
return null;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
+
function isPattern(color) {
|
|
101
|
+
return isArray(color) && color.length === 2;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// converts from a [<pattern name>, <color>] as used by pdfmake
|
|
105
|
+
// into [<pattern object>, <color>] as used by pdfkit
|
|
106
|
+
// (the pattern has to be registered in the doc definition of course)
|
|
107
|
+
function getPattern(color, patterns) {
|
|
108
|
+
return [patterns[color[0]], color[1]];
|
|
109
|
+
}
|
|
110
|
+
|
|
100
111
|
module.exports = {
|
|
101
112
|
isString: isString,
|
|
102
113
|
isNumber: isNumber,
|
|
@@ -109,5 +120,7 @@ module.exports = {
|
|
|
109
120
|
pack: pack,
|
|
110
121
|
fontStringify: fontStringify,
|
|
111
122
|
offsetVector: offsetVector,
|
|
112
|
-
getNodeId: getNodeId
|
|
123
|
+
getNodeId: getNodeId,
|
|
124
|
+
isPattern: isPattern,
|
|
125
|
+
getPattern: getPattern
|
|
113
126
|
};
|
package/src/pdfKitEngine.js
CHANGED
|
@@ -4,7 +4,7 @@ function _interopDefault(ex) {
|
|
|
4
4
|
return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
var PdfKit = _interopDefault(require('pdfkit'));
|
|
7
|
+
var PdfKit = _interopDefault(require('@foliojs-fork/pdfkit'));
|
|
8
8
|
|
|
9
9
|
function getEngineInstance() {
|
|
10
10
|
return PdfKit;
|