pdfmake 0.2.13 → 0.3.0-beta.10

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 (136) hide show
  1. package/CHANGELOG.md +23 -41
  2. package/README.md +11 -7
  3. package/build/pdfmake.js +22291 -23202
  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/eslint.config.mjs +52 -0
  15. package/fonts/Roboto/Roboto-Italic.ttf +0 -0
  16. package/fonts/Roboto/Roboto-Medium.ttf +0 -0
  17. package/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
  18. package/fonts/Roboto/Roboto-Regular.ttf +0 -0
  19. package/fonts/Roboto.js +8 -0
  20. package/js/3rd-party/svg-to-pdfkit/source.js +3626 -0
  21. package/js/3rd-party/svg-to-pdfkit.js +7 -0
  22. package/js/DocMeasure.js +626 -0
  23. package/js/DocPreprocessor.js +238 -0
  24. package/js/DocumentContext.js +288 -0
  25. package/js/ElementWriter.js +342 -0
  26. package/js/LayoutBuilder.js +881 -0
  27. package/js/Line.js +105 -0
  28. package/js/OutputDocument.js +76 -0
  29. package/js/OutputDocumentServer.js +27 -0
  30. package/js/PDFDocument.js +144 -0
  31. package/js/PageElementWriter.js +140 -0
  32. package/js/PageSize.js +74 -0
  33. package/js/Printer.js +291 -0
  34. package/js/Renderer.js +375 -0
  35. package/js/SVGMeasure.js +69 -0
  36. package/js/StyleContextStack.js +164 -0
  37. package/js/TableProcessor.js +524 -0
  38. package/js/TextBreaker.js +139 -0
  39. package/js/TextDecorator.js +143 -0
  40. package/js/TextInlines.js +206 -0
  41. package/js/URLResolver.js +73 -0
  42. package/js/base.js +52 -0
  43. package/js/browser-extensions/OutputDocumentBrowser.js +118 -0
  44. package/js/browser-extensions/URLBrowserResolver.js +76 -0
  45. package/js/browser-extensions/fonts/Roboto.js +38 -0
  46. package/js/browser-extensions/index.js +53 -0
  47. package/js/browser-extensions/pdfMake.js +3 -0
  48. package/js/browser-extensions/standard-fonts/Courier.js +38 -0
  49. package/js/browser-extensions/standard-fonts/Helvetica.js +38 -0
  50. package/js/browser-extensions/standard-fonts/Symbol.js +23 -0
  51. package/js/browser-extensions/standard-fonts/Times.js +38 -0
  52. package/js/browser-extensions/standard-fonts/ZapfDingbats.js +23 -0
  53. package/js/browser-extensions/virtual-fs-cjs.js +3 -0
  54. package/js/columnCalculator.js +148 -0
  55. package/js/helpers/node.js +98 -0
  56. package/js/helpers/tools.js +40 -0
  57. package/js/helpers/variableType.js +59 -0
  58. package/js/index.js +15 -0
  59. package/js/qrEnc.js +721 -0
  60. package/js/standardPageSizes.js +56 -0
  61. package/js/tableLayouts.js +98 -0
  62. package/js/virtual-fs.js +60 -0
  63. package/package.json +34 -28
  64. package/src/3rd-party/svg-to-pdfkit.js +2 -2
  65. package/src/DocMeasure.js +707 -0
  66. package/src/DocPreprocessor.js +264 -0
  67. package/src/DocumentContext.js +324 -0
  68. package/src/ElementWriter.js +405 -0
  69. package/src/LayoutBuilder.js +997 -0
  70. package/src/Line.js +114 -0
  71. package/src/OutputDocument.js +78 -0
  72. package/src/OutputDocumentServer.js +26 -0
  73. package/src/PDFDocument.js +174 -0
  74. package/src/PageElementWriter.js +160 -0
  75. package/src/PageSize.js +53 -0
  76. package/src/Printer.js +306 -0
  77. package/src/Renderer.js +405 -0
  78. package/src/SVGMeasure.js +79 -0
  79. package/src/StyleContextStack.js +175 -0
  80. package/src/TableProcessor.js +580 -0
  81. package/src/TextBreaker.js +149 -0
  82. package/src/TextDecorator.js +161 -0
  83. package/src/TextInlines.js +223 -0
  84. package/src/URLResolver.js +77 -0
  85. package/src/base.js +61 -0
  86. package/src/browser-extensions/OutputDocumentBrowser.js +117 -0
  87. package/src/browser-extensions/URLBrowserResolver.js +45 -57
  88. package/src/browser-extensions/fonts/Roboto.js +27 -0
  89. package/src/browser-extensions/index.js +55 -0
  90. package/src/browser-extensions/pdfMake.js +1 -329
  91. package/src/browser-extensions/standard-fonts/Courier.js +27 -0
  92. package/src/browser-extensions/standard-fonts/Helvetica.js +27 -0
  93. package/src/browser-extensions/standard-fonts/Symbol.js +21 -0
  94. package/src/browser-extensions/standard-fonts/Times.js +27 -0
  95. package/src/browser-extensions/standard-fonts/ZapfDingbats.js +21 -0
  96. package/src/browser-extensions/virtual-fs-cjs.js +1 -0
  97. package/src/columnCalculator.js +35 -38
  98. package/src/helpers/node.js +110 -0
  99. package/src/helpers/tools.js +39 -0
  100. package/src/helpers/variableType.js +50 -0
  101. package/src/index.js +16 -0
  102. package/src/qrEnc.js +15 -10
  103. package/src/standardPageSizes.js +1 -3
  104. package/src/tableLayouts.js +100 -0
  105. package/src/virtual-fs.js +66 -0
  106. package/standard-fonts/Courier.js +8 -0
  107. package/standard-fonts/Helvetica.js +9 -0
  108. package/standard-fonts/Symbol.js +5 -0
  109. package/standard-fonts/Times.js +8 -0
  110. package/standard-fonts/ZapfDingbats.js +5 -0
  111. package/.idea/codeStyles/Project.xml +0 -7
  112. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  113. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  114. package/.idea/misc.xml +0 -6
  115. package/.idea/modules.xml +0 -8
  116. package/.idea/pdfmake.iml +0 -11
  117. package/.idea/vcs.xml +0 -6
  118. package/src/browser-extensions/virtual-fs.js +0 -55
  119. package/src/docMeasure.js +0 -810
  120. package/src/docPreprocessor.js +0 -255
  121. package/src/documentContext.js +0 -328
  122. package/src/elementWriter.js +0 -333
  123. package/src/fontProvider.js +0 -68
  124. package/src/helpers.js +0 -138
  125. package/src/imageMeasure.js +0 -55
  126. package/src/layoutBuilder.js +0 -989
  127. package/src/line.js +0 -91
  128. package/src/pageElementWriter.js +0 -174
  129. package/src/pdfKitEngine.js +0 -21
  130. package/src/printer.js +0 -710
  131. package/src/styleContextStack.js +0 -138
  132. package/src/svgMeasure.js +0 -70
  133. package/src/tableProcessor.js +0 -584
  134. package/src/textDecorator.js +0 -157
  135. package/src/textTools.js +0 -373
  136. package/src/traversalTracker.js +0 -47
package/CHANGELOG.md CHANGED
@@ -1,7 +1,8 @@
1
1
  # Changelog
2
2
 
3
- ## 0.2.13 - 2024-09-22
3
+ ## 0.3.0-beta.10 - 2024-09-22
4
4
 
5
+ - Drop support Internet Explorer 11 (Microsoft will not support from 2022)
5
6
  - Minimal supported version Node.js 18 LTS
6
7
  - Update Roboto font (version 3.010)
7
8
  - Fixed page break in a column group
@@ -12,11 +13,7 @@
12
13
  - Fixed margins after page break
13
14
  - Fixed margins of nodes with relativePosition or absolutePosition are ignored and don't interfere with the regular flow of the layout
14
15
 
15
- ## 0.2.12 - 2024-08-14
16
-
17
- - Fixed error message of bad image definition
18
-
19
- ## 0.2.11 - 2024-08-09
16
+ ## 0.3.0-beta.9 - 2024-08-09
20
17
 
21
18
  - Fixed and validates input values headerRows and keepWithHeaderRows
22
19
  - Fixed numbering nested ordered lists
@@ -24,65 +21,50 @@
24
21
  - Fixed widths of table columns with percentages
25
22
  - Fixed storing the correct context in the ending cell of a row span when there were nested column groups (columns or tables)
26
23
 
27
- ## 0.2.10 - 2024-03-07
24
+ ## 0.3.0-beta.8 - 2024-03-07
28
25
 
29
26
  - Removed unused brfs dependency
30
27
 
31
- ## 0.2.9 - 2024-01-01
28
+ ## 0.3.0-beta.7 - 2024-01-01
32
29
 
30
+ - Minimal supported version Node.js 16 LTS
33
31
  - Added padding option for QR code
34
32
  - Allow the document language to be specified
35
33
  - Fixed cover image size inside table
36
34
  - Fixed "Cannot read properties of undefined (reading 'bottomMost')" if table contains too few rows
37
35
  - Fixed invalid source-maps in builded js file
38
36
 
39
- ## 0.2.8 - 2023-11-09
37
+ ## 0.3.0-beta.6 - 2023-11-09
40
38
 
41
39
  - Update pdfkit to 0.14.0
42
40
  - Update Roboto font (version 3.008)
43
41
 
44
- ## 0.2.7 - 2022-12-17
42
+ ## 0.3.0-beta.5 - 2023-02-19
43
+
44
+ - Fixed document buffer size. Node.js 18+ allow max 1 GiB.
45
45
 
46
+ ## 0.3.0-beta.4 - 2022-12-17
47
+
48
+ - Minimal supported version Node.js 14 LTS
46
49
  - Fixed theoretical vulnerability CVE-2022-46161 (**It was never part of version released as npm package or cdnjs or bower or packagist!**)
47
50
 
48
- ## 0.2.6 - 2022-10-09
51
+ ## 0.3.0-beta.3 - 2022-10-09
49
52
 
50
53
  - Updated Roboto font (version 3.005)
51
54
  - Fixed calculating auto page height
52
55
  - Fixed TrueType Collection loading from URL
53
56
  - Fixed refetching fonts from URL
54
57
 
55
- ## 0.2.5 - 2022-04-01
58
+ ## 0.3.0-beta.2 - 2022-04-01
56
59
 
60
+ - Attachments embedding
57
61
  - Support passing headers to request for loading font files and images via URL adresses
58
62
 
59
- ## 0.2.4 - 2021-11-10
60
-
61
- - Fixed destination path argument in VFS build script.
62
- - Fixed error "Object.isExtensible is not a function" (bug is in core-js version 3.19.1).
63
-
64
- ## 0.2.3 - 2021-11-06
65
-
66
- - Updated [@foliojs-fork/pdfkit](https://github.com/foliojs-fork/pdfkit) to version 0.13.0.
67
- - Tiling pattern support.
68
- - svg-to-pdfkit package moved as built-in. Solve not used installation of pdfkit.
69
- - Fixed passing document metadata.
70
-
71
- ## 0.2.2 - 2021-08-02
72
-
73
- - Fixed compatibility with Internet Explorer 11.
74
-
75
- ## 0.2.1 - 2021-08-02
76
-
77
- - Upgrade Unicode Line Breaking Algorithm (UAX #14) to Unicode 13.0.0.
78
- - Updated [@foliojs-fork/pdfkit](https://github.com/foliojs-fork/pdfkit) to version 0.12.3.
79
- - Updated [@foliojs-fork/linebreak](https://github.com/foliojs-fork/linebreak) to version 1.11.1.
80
-
81
- ## 0.2.0 - 2021-07-05
63
+ ## 0.3.0-beta.1 - 2022-01-01
82
64
 
83
- - Move to [@foliojs-fork](https://github.com/foliojs-fork) packages with up-to-date dependecies and security bug fixes and others. These are the libraries [@foliojs-fork/fontkit](https://github.com/foliojs-fork/fontkit), [@foliojs-fork/restructure](https://github.com/foliojs-fork/restructure), [@foliojs-fork/linebreak](https://github.com/foliojs-fork/linebreak) which are used in [@foliojs-fork/pdfkit](https://github.com/foliojs-fork/pdfkit).
84
- - Upgrade Unicode Line Breaking Algorithm (UAX #14) to Unicode 12.0.0
85
- - Introduced new `build-vfs.js` script to build virtual file system for fonts (see [documentation](https://pdfmake.github.io/docs/0.1/fonts/custom-fonts-client-side/vfs/)).
86
- - Removed support Node.js 8 and 10. Minimum required version is 12 LTS.
87
- - Removed support Internet Explorer 10. Supported only Internet Explorer 11.
88
- - Removed gulp.
65
+ - Port code base to ES6+
66
+ - Unify interface for node and browser **(breaking change)**
67
+ - All methods return promise instead of using callback **(breaking change)**
68
+ - Change including virtual font storage in client-side **(breaking change)**
69
+ - Change parameters of `pageBreakBefore` function **(breaking change)**
70
+ - Support for loading font files and images via URL adresses (https:// or http:// protocol) in Node.js (client and server side now)
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # pdfmake [![Node.js CI][githubactions_img]][githubactions_url] [![GitHub][github_img]][github_url] [![npm][npm_img]][npm_url] [![Bower][bower_img]][bower_url] [![Packagist][packagist_img]][packagist_url] [![CDNJS][cdnjs_img]][cndjs_url]
2
2
 
3
- [githubactions_img]: https://github.com/bpampuch/pdfmake/workflows/Node.js%20CI/badge.svg?branch=0.1
3
+ [githubactions_img]: https://github.com/bpampuch/pdfmake/workflows/Node.js%20CI/badge.svg?branch=master
4
4
  [githubactions_url]: https://github.com/bpampuch/pdfmake/actions
5
5
 
6
6
  [github_img]: https://img.shields.io/github/release/bpampuch/pdfmake.svg
@@ -19,9 +19,11 @@
19
19
  [cndjs_url]: https://cdnjs.com/libraries/pdfmake
20
20
 
21
21
 
22
- PDF document generation library for server-side and client-side usage in pure JavaScript.
22
+ PDF document generation library for server-side and client-side in pure JavaScript.
23
23
 
24
- Check out [the playground](http://bpampuch.github.io/pdfmake/playground.html) and [examples](https://github.com/bpampuch/pdfmake/tree/0.1/examples).
24
+ Check out [the playground](http://bpampuch.github.io/pdfmake/playground.html) and [examples](https://github.com/bpampuch/pdfmake/tree/master/examples).
25
+
26
+ #### This is unstable master branch for version 0.3.x, for stable use version 0.2.x see [branch 0.2](https://github.com/bpampuch/pdfmake/tree/0.2) or older version 0.1.x see [branch 0.1](https://github.com/bpampuch/pdfmake/tree/0.1).
25
27
 
26
28
  ### Features
27
29
 
@@ -49,13 +51,15 @@ Check out [the playground](http://bpampuch.github.io/pdfmake/playground.html) an
49
51
 
50
52
  ## Documentation
51
53
 
52
- Documentation URL: https://pdfmake.github.io/docs/
54
+ **Documentation URL: https://pdfmake.github.io/docs/**
55
+
56
+ Source of documentation: https://github.com/pdfmake/docs **Improvements are welcome!**
53
57
 
54
- ## Building from sources version 0.2.x
58
+ ## Building from sources
55
59
 
56
60
  using npm:
57
61
  ```
58
- git clone --branch 0.2 https://github.com/bpampuch/pdfmake.git
62
+ git clone https://github.com/bpampuch/pdfmake.git
59
63
  cd pdfmake
60
64
  npm install
61
65
  npm run build
@@ -63,7 +67,7 @@ npm run build
63
67
 
64
68
  using yarn:
65
69
  ```
66
- git clone --branch 0.2 https://github.com/bpampuch/pdfmake.git
70
+ git clone https://github.com/bpampuch/pdfmake.git
67
71
  cd pdfmake
68
72
  yarn
69
73
  yarn run build