pdfmake 0.3.0-beta.2 → 0.3.0-beta.4

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 (57) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/LICENSE +1 -1
  3. package/README.md +1 -1
  4. package/build/pdfmake.js +2988 -9785
  5. package/build/pdfmake.js.map +1 -1
  6. package/build/pdfmake.min.js +2 -2
  7. package/build/pdfmake.min.js.map +1 -1
  8. package/build/vfs_fonts.js +6 -5
  9. package/fonts/Roboto/Roboto-Italic.ttf +0 -0
  10. package/fonts/Roboto/Roboto-Medium.ttf +0 -0
  11. package/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
  12. package/fonts/Roboto/Roboto-Regular.ttf +0 -0
  13. package/js/3rd-party/svg-to-pdfkit/source.js +247 -920
  14. package/js/3rd-party/svg-to-pdfkit.js +0 -3
  15. package/js/DocMeasure.js +6 -139
  16. package/js/DocPreprocessor.js +2 -54
  17. package/js/DocumentContext.js +0 -40
  18. package/js/ElementWriter.js +2 -70
  19. package/js/LayoutBuilder.js +20 -165
  20. package/js/Line.js +6 -25
  21. package/js/OutputDocument.js +4 -13
  22. package/js/OutputDocumentServer.js +0 -6
  23. package/js/PDFDocument.js +1 -46
  24. package/js/PageElementWriter.js +7 -31
  25. package/js/PageSize.js +2 -16
  26. package/js/Printer.js +50 -59
  27. package/js/Renderer.js +11 -98
  28. package/js/SVGMeasure.js +1 -20
  29. package/js/StyleContextStack.js +12 -36
  30. package/js/TableProcessor.js +36 -117
  31. package/js/TextBreaker.js +2 -44
  32. package/js/TextDecorator.js +1 -38
  33. package/js/TextInlines.js +8 -49
  34. package/js/URLResolver.js +10 -18
  35. package/js/base.js +1 -17
  36. package/js/browser-extensions/OutputDocumentBrowser.js +5 -17
  37. package/js/browser-extensions/URLBrowserResolver.js +0 -17
  38. package/js/browser-extensions/fonts/Roboto.js +0 -4
  39. package/js/browser-extensions/index.js +0 -16
  40. package/js/browser-extensions/pdfMake.js +2 -4
  41. package/js/browser-extensions/standard-fonts/Courier.js +0 -4
  42. package/js/browser-extensions/standard-fonts/Helvetica.js +0 -4
  43. package/js/browser-extensions/standard-fonts/Symbol.js +0 -4
  44. package/js/browser-extensions/standard-fonts/Times.js +0 -4
  45. package/js/browser-extensions/standard-fonts/ZapfDingbats.js +0 -4
  46. package/js/columnCalculator.js +6 -18
  47. package/js/helpers/node.js +3 -27
  48. package/js/helpers/tools.js +0 -8
  49. package/js/helpers/variableType.js +4 -9
  50. package/js/index.js +0 -6
  51. package/js/qrEnc.js +126 -215
  52. package/js/tableLayouts.js +1 -28
  53. package/js/virtual-fs.js +3 -19
  54. package/package.json +2 -2
  55. package/src/3rd-party/svg-to-pdfkit/LICENSE +9 -9
  56. package/src/Printer.js +41 -13
  57. package/src/URLResolver.js +10 -5
@@ -3,13 +3,10 @@
3
3
  exports.__esModule = true;
4
4
  exports.offsetVector = offsetVector;
5
5
  exports.pack = pack;
6
-
7
6
  function pack(...args) {
8
7
  let result = {};
9
-
10
8
  for (let i = 0, l = args.length; i < l; i++) {
11
9
  let obj = args[i];
12
-
13
10
  if (obj) {
14
11
  for (let key in obj) {
15
12
  if (obj.hasOwnProperty(key)) {
@@ -18,10 +15,8 @@ function pack(...args) {
18
15
  }
19
16
  }
20
17
  }
21
-
22
18
  return result;
23
19
  }
24
-
25
20
  function offsetVector(vector, x, y) {
26
21
  switch (vector.type) {
27
22
  case 'ellipse':
@@ -29,20 +24,17 @@ function offsetVector(vector, x, y) {
29
24
  vector.x += x;
30
25
  vector.y += y;
31
26
  break;
32
-
33
27
  case 'line':
34
28
  vector.x1 += x;
35
29
  vector.x2 += x;
36
30
  vector.y1 += y;
37
31
  vector.y2 += y;
38
32
  break;
39
-
40
33
  case 'polyline':
41
34
  for (let i = 0, l = vector.points.length; i < l; i++) {
42
35
  vector.points[i].x += x;
43
36
  vector.points[i].y += y;
44
37
  }
45
-
46
38
  break;
47
39
  }
48
40
  }
@@ -6,7 +6,6 @@ exports.isNumber = isNumber;
6
6
  exports.isObject = isObject;
7
7
  exports.isString = isString;
8
8
  exports.isValue = isValue;
9
-
10
9
  /**
11
10
  * @param {any} variable
12
11
  * @returns {boolean}
@@ -14,39 +13,35 @@ exports.isValue = isValue;
14
13
  function isString(variable) {
15
14
  return typeof variable === 'string' || variable instanceof String;
16
15
  }
16
+
17
17
  /**
18
18
  * @param {any} variable
19
19
  * @returns {boolean}
20
20
  */
21
-
22
-
23
21
  function isNumber(variable) {
24
22
  return typeof variable === 'number' || variable instanceof Number;
25
23
  }
24
+
26
25
  /**
27
26
  * @param {any} variable
28
27
  * @returns {boolean}
29
28
  */
30
-
31
-
32
29
  function isObject(variable) {
33
30
  return variable !== null && !Array.isArray(variable) && !isString(variable) && !isNumber(variable) && typeof variable === 'object';
34
31
  }
32
+
35
33
  /**
36
34
  * @param {any} variable
37
35
  * @returns {boolean}
38
36
  */
39
-
40
-
41
37
  function isEmptyObject(variable) {
42
38
  return isObject(variable) && Object.keys(variable).length === 0;
43
39
  }
40
+
44
41
  /**
45
42
  * @param {any} variable
46
43
  * @returns {boolean}
47
44
  */
48
-
49
-
50
45
  function isValue(variable) {
51
46
  return variable !== undefined && variable !== null;
52
47
  }
package/js/index.js CHANGED
@@ -1,21 +1,15 @@
1
1
  "use strict";
2
2
 
3
3
  const pdfmakeBase = require('./base').default;
4
-
5
4
  const OutputDocumentServer = require('./OutputDocumentServer').default;
6
-
7
5
  const URLResolver = require('./URLResolver').default;
8
-
9
6
  class pdfmake extends pdfmakeBase {
10
7
  constructor() {
11
8
  super();
12
9
  this.urlResolver = new URLResolver(this.virtualfs);
13
10
  }
14
-
15
11
  _transformToDocument(doc) {
16
12
  return new OutputDocumentServer(doc);
17
13
  }
18
-
19
14
  }
20
-
21
15
  module.exports = new pdfmake();