pdfmake 0.2.4 → 0.3.0-beta.2

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.
Files changed (128) hide show
  1. package/CHANGELOG.md +10 -27
  2. package/README.md +11 -7
  3. package/build/pdfmake.js +44733 -42435
  4. package/build/pdfmake.js.map +1 -1
  5. package/build/pdfmake.min.js +2 -2
  6. package/build/pdfmake.min.js.map +1 -1
  7. package/build/standard-fonts/Courier.js +27 -0
  8. package/build/standard-fonts/Helvetica.js +27 -0
  9. package/build/standard-fonts/Symbol.js +21 -0
  10. package/build/standard-fonts/Times.js +27 -0
  11. package/build/standard-fonts/ZapfDingbats.js +21 -0
  12. package/build/vfs_fonts.js +2 -2
  13. package/build-vfs.js +2 -2
  14. package/fonts/Roboto/Roboto-Italic.ttf +0 -0
  15. package/fonts/Roboto/Roboto-Medium.ttf +0 -0
  16. package/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
  17. package/fonts/Roboto/Roboto-Regular.ttf +0 -0
  18. package/fonts/Roboto.js +8 -0
  19. package/js/3rd-party/svg-to-pdfkit/source.js +4301 -0
  20. package/js/3rd-party/svg-to-pdfkit.js +11 -0
  21. package/js/DocMeasure.js +758 -0
  22. package/js/DocPreprocessor.js +291 -0
  23. package/js/DocumentContext.js +306 -0
  24. package/js/ElementWriter.js +400 -0
  25. package/js/LayoutBuilder.js +840 -0
  26. package/js/Line.js +125 -0
  27. package/js/OutputDocument.js +86 -0
  28. package/js/OutputDocumentServer.js +34 -0
  29. package/js/PDFDocument.js +190 -0
  30. package/js/PageElementWriter.js +165 -0
  31. package/js/PageSize.js +88 -0
  32. package/js/Printer.js +300 -0
  33. package/js/Renderer.js +463 -0
  34. package/js/SVGMeasure.js +89 -0
  35. package/js/StyleContextStack.js +206 -0
  36. package/js/TableProcessor.js +590 -0
  37. package/js/TextBreaker.js +182 -0
  38. package/js/TextDecorator.js +181 -0
  39. package/js/TextInlines.js +248 -0
  40. package/js/URLResolver.js +82 -0
  41. package/js/base.js +69 -0
  42. package/js/browser-extensions/OutputDocumentBrowser.js +131 -0
  43. package/js/browser-extensions/URLBrowserResolver.js +94 -0
  44. package/js/browser-extensions/fonts/Roboto.js +42 -0
  45. package/js/browser-extensions/index.js +70 -0
  46. package/js/browser-extensions/pdfMake.js +17 -0
  47. package/js/browser-extensions/standard-fonts/Courier.js +42 -0
  48. package/js/browser-extensions/standard-fonts/Helvetica.js +42 -0
  49. package/js/browser-extensions/standard-fonts/Symbol.js +27 -0
  50. package/js/browser-extensions/standard-fonts/Times.js +42 -0
  51. package/js/browser-extensions/standard-fonts/ZapfDingbats.js +27 -0
  52. package/js/browser-extensions/virtual-fs-cjs.js +3 -0
  53. package/js/columnCalculator.js +142 -0
  54. package/js/helpers/node.js +122 -0
  55. package/js/helpers/tools.js +48 -0
  56. package/js/helpers/variableType.js +52 -0
  57. package/js/index.js +21 -0
  58. package/js/qrEnc.js +810 -0
  59. package/js/standardPageSizes.js +57 -0
  60. package/js/tableLayouts.js +127 -0
  61. package/js/virtual-fs.js +77 -0
  62. package/package.json +26 -22
  63. package/src/3rd-party/svg-to-pdfkit.js +2 -2
  64. package/src/DocMeasure.js +703 -0
  65. package/src/DocPreprocessor.js +264 -0
  66. package/src/DocumentContext.js +309 -0
  67. package/src/ElementWriter.js +394 -0
  68. package/src/LayoutBuilder.js +821 -0
  69. package/src/Line.js +114 -0
  70. package/src/OutputDocument.js +78 -0
  71. package/src/OutputDocumentServer.js +26 -0
  72. package/src/PDFDocument.js +174 -0
  73. package/src/PageElementWriter.js +160 -0
  74. package/src/PageSize.js +53 -0
  75. package/src/Printer.js +277 -0
  76. package/src/Renderer.js +405 -0
  77. package/src/SVGMeasure.js +79 -0
  78. package/src/StyleContextStack.js +216 -0
  79. package/src/TableProcessor.js +558 -0
  80. package/src/TextBreaker.js +149 -0
  81. package/src/TextDecorator.js +161 -0
  82. package/src/TextInlines.js +223 -0
  83. package/src/URLResolver.js +72 -0
  84. package/src/base.js +61 -0
  85. package/src/browser-extensions/OutputDocumentBrowser.js +117 -0
  86. package/src/browser-extensions/URLBrowserResolver.js +49 -53
  87. package/src/browser-extensions/fonts/Roboto.js +27 -0
  88. package/src/browser-extensions/index.js +55 -0
  89. package/src/browser-extensions/pdfMake.js +10 -282
  90. package/src/browser-extensions/standard-fonts/Courier.js +27 -0
  91. package/src/browser-extensions/standard-fonts/Helvetica.js +27 -0
  92. package/src/browser-extensions/standard-fonts/Symbol.js +21 -0
  93. package/src/browser-extensions/standard-fonts/Times.js +27 -0
  94. package/src/browser-extensions/standard-fonts/ZapfDingbats.js +21 -0
  95. package/src/browser-extensions/virtual-fs-cjs.js +1 -0
  96. package/src/columnCalculator.js +29 -32
  97. package/src/helpers/node.js +110 -0
  98. package/src/helpers/tools.js +39 -0
  99. package/src/helpers/variableType.js +39 -0
  100. package/src/index.js +16 -0
  101. package/src/qrEnc.js +15 -10
  102. package/src/standardPageSizes.js +1 -3
  103. package/src/tableLayouts.js +100 -0
  104. package/src/virtual-fs.js +66 -0
  105. package/standard-fonts/Courier.js +8 -0
  106. package/standard-fonts/Helvetica.js +9 -0
  107. package/standard-fonts/Symbol.js +5 -0
  108. package/standard-fonts/Times.js +8 -0
  109. package/standard-fonts/ZapfDingbats.js +5 -0
  110. package/src/browser-extensions/virtual-fs.js +0 -55
  111. package/src/docMeasure.js +0 -807
  112. package/src/docPreprocessor.js +0 -255
  113. package/src/documentContext.js +0 -314
  114. package/src/elementWriter.js +0 -322
  115. package/src/fontProvider.js +0 -68
  116. package/src/helpers.js +0 -126
  117. package/src/imageMeasure.js +0 -51
  118. package/src/layoutBuilder.js +0 -807
  119. package/src/line.js +0 -91
  120. package/src/pageElementWriter.js +0 -174
  121. package/src/pdfKitEngine.js +0 -21
  122. package/src/printer.js +0 -705
  123. package/src/styleContextStack.js +0 -179
  124. package/src/svgMeasure.js +0 -70
  125. package/src/tableProcessor.js +0 -561
  126. package/src/textDecorator.js +0 -157
  127. package/src/textTools.js +0 -373
  128. package/src/traversalTracker.js +0 -47
package/js/base.js ADDED
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _Printer = _interopRequireDefault(require("./Printer"));
7
+
8
+ var _virtualFs = _interopRequireDefault(require("./virtual-fs"));
9
+
10
+ var _tools = require("./helpers/tools");
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ class pdfmake {
15
+ constructor() {
16
+ this.virtualfs = _virtualFs.default;
17
+ this.urlResolver = null;
18
+ }
19
+ /**
20
+ * @param {object} docDefinition
21
+ * @param {?object} options
22
+ * @returns {object}
23
+ */
24
+
25
+
26
+ createPdf(docDefinition, options = {}) {
27
+ options.progressCallback = this.progressCallback;
28
+ options.tableLayouts = this.tableLayouts;
29
+ let printer = new _Printer.default(this.fonts, this.virtualfs, this.urlResolver);
30
+ const pdfDocumentPromise = printer.createPdfKitDocument(docDefinition, options);
31
+ return this._transformToDocument(pdfDocumentPromise);
32
+ }
33
+
34
+ setProgressCallback(callback) {
35
+ this.progressCallback = callback;
36
+ }
37
+
38
+ addTableLayouts(tableLayouts) {
39
+ this.tableLayouts = (0, _tools.pack)(this.tableLayouts, tableLayouts);
40
+ }
41
+
42
+ setTableLayouts(tableLayouts) {
43
+ this.tableLayouts = tableLayouts;
44
+ }
45
+
46
+ clearTableLayouts() {
47
+ this.tableLayouts = {};
48
+ }
49
+
50
+ addFonts(fonts) {
51
+ this.fonts = (0, _tools.pack)(this.fonts, fonts);
52
+ }
53
+
54
+ setFonts(fonts) {
55
+ this.fonts = fonts;
56
+ }
57
+
58
+ clearFonts() {
59
+ this.fonts = {};
60
+ }
61
+
62
+ _transformToDocument(doc) {
63
+ return doc;
64
+ }
65
+
66
+ }
67
+
68
+ var _default = pdfmake;
69
+ exports.default = _default;
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _OutputDocument = _interopRequireDefault(require("../OutputDocument"));
7
+
8
+ var _fileSaver = require("file-saver");
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+
12
+ /**
13
+ * @returns {Window}
14
+ */
15
+ const openWindow = () => {
16
+ // we have to open the window immediately and store the reference
17
+ // otherwise popup blockers will stop us
18
+ let win = window.open('', '_blank');
19
+
20
+ if (win === null) {
21
+ throw new Error('Open PDF in new window blocked by browser');
22
+ }
23
+
24
+ return win;
25
+ };
26
+
27
+ class OutputDocumentBrowser extends _OutputDocument.default {
28
+ /**
29
+ * @returns {Promise<Blob>}
30
+ */
31
+ getBlob() {
32
+ return new Promise((resolve, reject) => {
33
+ this.getBuffer().then(buffer => {
34
+ try {
35
+ let blob = new Blob([buffer], {
36
+ type: 'application/pdf'
37
+ });
38
+ resolve(blob);
39
+ } catch (e) {
40
+ reject(e);
41
+ }
42
+ }, result => {
43
+ reject(result);
44
+ });
45
+ });
46
+ }
47
+ /**
48
+ * @param {string} filename
49
+ * @returns {Promise}
50
+ */
51
+
52
+
53
+ download(filename = 'file.pdf') {
54
+ return new Promise((resolve, reject) => {
55
+ this.getBlob().then(blob => {
56
+ try {
57
+ (0, _fileSaver.saveAs)(blob, filename);
58
+ resolve();
59
+ } catch (e) {
60
+ reject(e);
61
+ }
62
+ }, result => {
63
+ reject(result);
64
+ });
65
+ });
66
+ }
67
+ /**
68
+ * @param {Window} win
69
+ * @returns {Promise}
70
+ */
71
+
72
+
73
+ open(win = null) {
74
+ return new Promise((resolve, reject) => {
75
+ if (!win) {
76
+ win = openWindow();
77
+ }
78
+
79
+ this.getBlob().then(blob => {
80
+ try {
81
+ let urlCreator = window.URL || window.webkitURL;
82
+ let pdfUrl = urlCreator.createObjectURL(blob);
83
+ win.location.href = pdfUrl; //
84
+
85
+ resolve();
86
+ /* temporarily disabled
87
+ if (win === window) {
88
+ resolve();
89
+ } else {
90
+ setTimeout(() => {
91
+ if (win.window === null) { // is closed by AdBlock
92
+ window.location.href = pdfUrl; // open in actual window
93
+ }
94
+ resolve();
95
+ }, 500);
96
+ }
97
+ */
98
+ } catch (e) {
99
+ win.close();
100
+ reject(e);
101
+ }
102
+ }, result => {
103
+ reject(result);
104
+ });
105
+ });
106
+ }
107
+ /**
108
+ * @param {Window} win
109
+ * @returns {Promise}
110
+ */
111
+
112
+
113
+ print(win = null) {
114
+ return new Promise((resolve, reject) => {
115
+ this.getStream().then(stream => {
116
+ stream.setOpenActionAsPrint();
117
+ return this.open(win).then(() => {
118
+ resolve();
119
+ }, result => {
120
+ reject(result);
121
+ });
122
+ }, result => {
123
+ reject(result);
124
+ });
125
+ });
126
+ }
127
+
128
+ }
129
+
130
+ var _default = OutputDocumentBrowser;
131
+ exports.default = _default;
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ const fetchUrl = (url, headers = {}) => {
7
+ return new Promise((resolve, reject) => {
8
+ const xhr = new XMLHttpRequest();
9
+ xhr.open('GET', url, true);
10
+
11
+ for (let headerName in headers) {
12
+ xhr.setRequestHeader(headerName, headers[headerName]);
13
+ }
14
+
15
+ xhr.responseType = 'arraybuffer';
16
+
17
+ xhr.onreadystatechange = () => {
18
+ if (xhr.readyState !== 4) {
19
+ return;
20
+ }
21
+
22
+ const ok = xhr.status >= 200 && xhr.status < 300;
23
+
24
+ if (!ok) {
25
+ setTimeout(() => {
26
+ reject(new TypeError(`Failed to fetch (url: "${url}")`));
27
+ }, 0);
28
+ }
29
+ };
30
+
31
+ xhr.onload = () => {
32
+ const ok = xhr.status >= 200 && xhr.status < 300;
33
+
34
+ if (ok) {
35
+ resolve(xhr.response);
36
+ }
37
+ };
38
+
39
+ xhr.onerror = () => {
40
+ setTimeout(() => {
41
+ reject(new TypeError(`Network request failed (url: "${url}")`));
42
+ }, 0);
43
+ };
44
+
45
+ xhr.ontimeout = () => {
46
+ setTimeout(() => {
47
+ reject(new TypeError(`Network request failed (url: "${url}")`));
48
+ }, 0);
49
+ };
50
+
51
+ xhr.send();
52
+ });
53
+ };
54
+
55
+ class URLBrowserResolver {
56
+ constructor(fs) {
57
+ this.fs = fs;
58
+ this.resolving = {};
59
+ }
60
+
61
+ resolve(url, headers = {}) {
62
+ if (!this.resolving[url]) {
63
+ this.resolving[url] = new Promise((resolve, reject) => {
64
+ if (url.toLowerCase().indexOf('https://') === 0 || url.toLowerCase().indexOf('http://') === 0) {
65
+ fetchUrl(url, headers).then(buffer => {
66
+ this.fs.writeFileSync(url, buffer);
67
+ resolve();
68
+ }, result => {
69
+ reject(result);
70
+ });
71
+ } else {
72
+ // cannot be resolved
73
+ resolve();
74
+ }
75
+ });
76
+ }
77
+
78
+ return this.resolving[url];
79
+ }
80
+
81
+ resolved() {
82
+ return new Promise((resolve, reject) => {
83
+ Promise.all(Object.values(this.resolving)).then(() => {
84
+ resolve();
85
+ }, result => {
86
+ reject(result);
87
+ });
88
+ });
89
+ }
90
+
91
+ }
92
+
93
+ var _default = URLBrowserResolver;
94
+ exports.default = _default;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ var fs = require('fs');
4
+
5
+ var fontContainer = {
6
+ vfs: {
7
+ 'Roboto-Regular.ttf': {
8
+ data: fs.readFileSync(__dirname + '/../../../fonts/Roboto/Roboto-Regular.ttf', 'base64'),
9
+ encoding: 'base64'
10
+ },
11
+ 'Roboto-Medium.ttf': {
12
+ data: fs.readFileSync(__dirname + '/../../../fonts/Roboto/Roboto-Medium.ttf', 'base64'),
13
+ encoding: 'base64'
14
+ },
15
+ 'Roboto-Italic.ttf': {
16
+ data: fs.readFileSync(__dirname + '/../../../fonts/Roboto/Roboto-Italic.ttf', 'base64'),
17
+ encoding: 'base64'
18
+ },
19
+ 'Roboto-MediumItalic.ttf': {
20
+ data: fs.readFileSync(__dirname + '/../../../fonts/Roboto/Roboto-MediumItalic.ttf', 'base64'),
21
+ encoding: 'base64'
22
+ }
23
+ },
24
+ fonts: {
25
+ Roboto: {
26
+ normal: 'Roboto-Regular.ttf',
27
+ bold: 'Roboto-Medium.ttf',
28
+ italics: 'Roboto-Italic.ttf',
29
+ bolditalics: 'Roboto-MediumItalic.ttf'
30
+ }
31
+ }
32
+ };
33
+
34
+ var _global = typeof window === 'object' ? window : typeof global === 'object' ? global : typeof self === 'object' ? self : void 0;
35
+
36
+ if (typeof _global.pdfMake !== 'undefined' && typeof _global.pdfMake.addFontContainer !== 'undefined') {
37
+ _global.pdfMake.addFontContainer(fontContainer);
38
+ }
39
+
40
+ if (typeof module !== 'undefined') {
41
+ module.exports = fontContainer;
42
+ }
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _base = _interopRequireDefault(require("../base"));
7
+
8
+ var _OutputDocumentBrowser = _interopRequireDefault(require("./OutputDocumentBrowser"));
9
+
10
+ var _URLBrowserResolver = _interopRequireDefault(require("./URLBrowserResolver"));
11
+
12
+ var _fs = _interopRequireDefault(require("fs"));
13
+
14
+ var _configurator = _interopRequireDefault(require("core-js/configurator"));
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+
18
+ // core-js: Polyfills will be used only if natives completely unavailable.
19
+ (0, _configurator.default)({
20
+ useNative: ['Promise']
21
+ });
22
+ let defaultClientFonts = {
23
+ Roboto: {
24
+ normal: 'Roboto-Regular.ttf',
25
+ bold: 'Roboto-Medium.ttf',
26
+ italics: 'Roboto-Italic.ttf',
27
+ bolditalics: 'Roboto-MediumItalic.ttf'
28
+ }
29
+ };
30
+
31
+ class pdfmake extends _base.default {
32
+ constructor() {
33
+ super();
34
+ this.urlResolver = new _URLBrowserResolver.default(this.virtualfs);
35
+ this.fonts = defaultClientFonts;
36
+ }
37
+
38
+ addFontContainer(fontContainer) {
39
+ this.addVirtualFileSystem(fontContainer.vfs);
40
+ this.addFonts(fontContainer.fonts);
41
+ }
42
+
43
+ addVirtualFileSystem(vfs) {
44
+ for (let key in vfs) {
45
+ if (vfs.hasOwnProperty(key)) {
46
+ let data;
47
+ let encoding;
48
+
49
+ if (typeof vfs[key] === 'object') {
50
+ data = vfs[key].data;
51
+ encoding = vfs[key].encoding || 'base64';
52
+ } else {
53
+ data = vfs[key];
54
+ encoding = 'base64';
55
+ }
56
+
57
+ _fs.default.writeFileSync(key, data, encoding);
58
+ }
59
+ }
60
+ }
61
+
62
+ _transformToDocument(doc) {
63
+ return new _OutputDocumentBrowser.default(doc);
64
+ }
65
+
66
+ }
67
+
68
+ var _default = new pdfmake();
69
+
70
+ exports.default = _default;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ const isBrowserSupported = () => {
4
+ if (typeof window === 'undefined' || typeof window.navigator === 'undefined') {
5
+ // Enviroment is not browser.
6
+ return true;
7
+ } // Internet Explorer 10 and older is not supported.
8
+
9
+
10
+ return window.navigator.userAgent.indexOf("MSIE") === -1;
11
+ };
12
+
13
+ if (!isBrowserSupported()) {
14
+ throw new Error('pdfmake: Internet Explorer 10 and older is not supported. Upgrade to version 11 or use modern browser.');
15
+ }
16
+
17
+ module.exports = require('./index').default;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ var fs = require('fs');
4
+
5
+ var fontContainer = {
6
+ vfs: {
7
+ 'data/Courier.afm': {
8
+ data: fs.readFileSync(__dirname + '/../../../node_modules/@foliojs-fork/pdfkit/js/data/Courier.afm', 'utf8'),
9
+ encoding: 'utf8'
10
+ },
11
+ 'data/Courier-Bold.afm': {
12
+ data: fs.readFileSync(__dirname + '/../../../node_modules/@foliojs-fork/pdfkit/js/data/Courier-Bold.afm', 'utf8'),
13
+ encoding: 'utf8'
14
+ },
15
+ 'data/Courier-Oblique.afm': {
16
+ data: fs.readFileSync(__dirname + '/../../../node_modules/@foliojs-fork/pdfkit/js/data/Courier-Oblique.afm', 'utf8'),
17
+ encoding: 'utf8'
18
+ },
19
+ 'data/Courier-BoldOblique.afm': {
20
+ data: fs.readFileSync(__dirname + '/../../../node_modules/@foliojs-fork/pdfkit/js/data/Courier-BoldOblique.afm', 'utf8'),
21
+ encoding: 'utf8'
22
+ }
23
+ },
24
+ fonts: {
25
+ Courier: {
26
+ normal: 'Courier',
27
+ bold: 'Courier-Bold',
28
+ italics: 'Courier-Oblique',
29
+ bolditalics: 'Courier-BoldOblique'
30
+ }
31
+ }
32
+ };
33
+
34
+ var _global = typeof window === 'object' ? window : typeof global === 'object' ? global : typeof self === 'object' ? self : void 0;
35
+
36
+ if (typeof _global.pdfMake !== 'undefined' && typeof _global.pdfMake.addFontContainer !== 'undefined') {
37
+ _global.pdfMake.addFontContainer(fontContainer);
38
+ }
39
+
40
+ if (typeof module !== 'undefined') {
41
+ module.exports = fontContainer;
42
+ }
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ var fs = require('fs');
4
+
5
+ var fontContainer = {
6
+ vfs: {
7
+ 'data/Helvetica.afm': {
8
+ data: fs.readFileSync(__dirname + '/../../../node_modules/@foliojs-fork/pdfkit/js/data/Helvetica.afm', 'utf8'),
9
+ encoding: 'utf8'
10
+ },
11
+ 'data/Helvetica-Bold.afm': {
12
+ data: fs.readFileSync(__dirname + '/../../../node_modules/@foliojs-fork/pdfkit/js/data/Helvetica-Bold.afm', 'utf8'),
13
+ encoding: 'utf8'
14
+ },
15
+ 'data/Helvetica-Oblique.afm': {
16
+ data: fs.readFileSync(__dirname + '/../../../node_modules/@foliojs-fork/pdfkit/js/data/Helvetica-Oblique.afm', 'utf8'),
17
+ encoding: 'utf8'
18
+ },
19
+ 'data/Helvetica-BoldOblique.afm': {
20
+ data: fs.readFileSync(__dirname + '/../../../node_modules/@foliojs-fork/pdfkit/js/data/Helvetica-BoldOblique.afm', 'utf8'),
21
+ encoding: 'utf8'
22
+ }
23
+ },
24
+ fonts: {
25
+ Helvetica: {
26
+ normal: 'Helvetica',
27
+ bold: 'Helvetica-Bold',
28
+ italics: 'Helvetica-Oblique',
29
+ bolditalics: 'Helvetica-BoldOblique'
30
+ }
31
+ }
32
+ };
33
+
34
+ var _global = typeof window === 'object' ? window : typeof global === 'object' ? global : typeof self === 'object' ? self : void 0;
35
+
36
+ if (typeof _global.pdfMake !== 'undefined' && typeof _global.pdfMake.addFontContainer !== 'undefined') {
37
+ _global.pdfMake.addFontContainer(fontContainer);
38
+ }
39
+
40
+ if (typeof module !== 'undefined') {
41
+ module.exports = fontContainer;
42
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ var fs = require('fs');
4
+
5
+ var fontContainer = {
6
+ vfs: {
7
+ 'data/Symbol.afm': {
8
+ data: fs.readFileSync(__dirname + '/../../../node_modules/@foliojs-fork/pdfkit/js/data/Symbol.afm', 'utf8'),
9
+ encoding: 'utf8'
10
+ }
11
+ },
12
+ fonts: {
13
+ Symbol: {
14
+ normal: 'Symbol'
15
+ }
16
+ }
17
+ };
18
+
19
+ var _global = typeof window === 'object' ? window : typeof global === 'object' ? global : typeof self === 'object' ? self : void 0;
20
+
21
+ if (typeof _global.pdfMake !== 'undefined' && typeof _global.pdfMake.addFontContainer !== 'undefined') {
22
+ _global.pdfMake.addFontContainer(fontContainer);
23
+ }
24
+
25
+ if (typeof module !== 'undefined') {
26
+ module.exports = fontContainer;
27
+ }
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ var fs = require('fs');
4
+
5
+ var fontContainer = {
6
+ vfs: {
7
+ 'data/Times-Roman.afm': {
8
+ data: fs.readFileSync(__dirname + '/../../../node_modules/@foliojs-fork/pdfkit/js/data/Times-Roman.afm', 'utf8'),
9
+ encoding: 'utf8'
10
+ },
11
+ 'data/Times-Bold.afm': {
12
+ data: fs.readFileSync(__dirname + '/../../../node_modules/@foliojs-fork/pdfkit/js/data/Times-Bold.afm', 'utf8'),
13
+ encoding: 'utf8'
14
+ },
15
+ 'data/Times-Italic.afm': {
16
+ data: fs.readFileSync(__dirname + '/../../../node_modules/@foliojs-fork/pdfkit/js/data/Times-Italic.afm', 'utf8'),
17
+ encoding: 'utf8'
18
+ },
19
+ 'data/Times-BoldItalic.afm': {
20
+ data: fs.readFileSync(__dirname + '/../../../node_modules/@foliojs-fork/pdfkit/js/data/Times-BoldItalic.afm', 'utf8'),
21
+ encoding: 'utf8'
22
+ }
23
+ },
24
+ fonts: {
25
+ Times: {
26
+ normal: 'Times-Roman',
27
+ bold: 'Times-Bold',
28
+ italics: 'Times-Italic',
29
+ bolditalics: 'Times-BoldItalic'
30
+ }
31
+ }
32
+ };
33
+
34
+ var _global = typeof window === 'object' ? window : typeof global === 'object' ? global : typeof self === 'object' ? self : void 0;
35
+
36
+ if (typeof _global.pdfMake !== 'undefined' && typeof _global.pdfMake.addFontContainer !== 'undefined') {
37
+ _global.pdfMake.addFontContainer(fontContainer);
38
+ }
39
+
40
+ if (typeof module !== 'undefined') {
41
+ module.exports = fontContainer;
42
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ var fs = require('fs');
4
+
5
+ var fontContainer = {
6
+ vfs: {
7
+ 'data/ZapfDingbats.afm': {
8
+ data: fs.readFileSync(__dirname + '/../../../node_modules/@foliojs-fork/pdfkit/js/data/ZapfDingbats.afm', 'utf8'),
9
+ encoding: 'utf8'
10
+ }
11
+ },
12
+ fonts: {
13
+ ZapfDingbats: {
14
+ normal: 'ZapfDingbats'
15
+ }
16
+ }
17
+ };
18
+
19
+ var _global = typeof window === 'object' ? window : typeof global === 'object' ? global : typeof self === 'object' ? self : void 0;
20
+
21
+ if (typeof _global.pdfMake !== 'undefined' && typeof _global.pdfMake.addFontContainer !== 'undefined') {
22
+ _global.pdfMake.addFontContainer(fontContainer);
23
+ }
24
+
25
+ if (typeof module !== 'undefined') {
26
+ module.exports = fontContainer;
27
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+
3
+ module.exports = require('../virtual-fs').default;