pdfmake 0.3.3 → 0.3.5

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 (93) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/LICENSE +21 -21
  3. package/README.md +76 -78
  4. package/build/fonts/Roboto/Roboto-Italic.ttf +0 -0
  5. package/build/fonts/Roboto/Roboto-Medium.ttf +0 -0
  6. package/build/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
  7. package/build/fonts/Roboto/Roboto-Regular.ttf +0 -0
  8. package/build/fonts/Roboto.js +27 -0
  9. package/build/pdfmake.js +65042 -64408
  10. package/build/pdfmake.js.map +1 -1
  11. package/build/pdfmake.min.js +2 -2
  12. package/build/pdfmake.min.js.map +1 -1
  13. package/build/standard-fonts/Courier.js +27 -27
  14. package/build/standard-fonts/Helvetica.js +27 -27
  15. package/build/standard-fonts/Symbol.js +21 -21
  16. package/build/standard-fonts/Times.js +27 -27
  17. package/build/standard-fonts/ZapfDingbats.js +21 -21
  18. package/build/vfs_fonts.js +5 -5
  19. package/build-vfs.js +44 -44
  20. package/fonts/Roboto.js +8 -8
  21. package/js/DocMeasure.js +9 -6
  22. package/js/DocumentContext.js +236 -7
  23. package/js/ElementWriter.js +42 -16
  24. package/js/LayoutBuilder.js +277 -86
  25. package/js/Line.js +16 -16
  26. package/js/OutputDocument.js +10 -10
  27. package/js/OutputDocumentServer.js +3 -3
  28. package/js/PDFDocument.js +6 -4
  29. package/js/PageElementWriter.js +124 -11
  30. package/js/Printer.js +28 -28
  31. package/js/Renderer.js +53 -8
  32. package/js/SVGMeasure.js +14 -12
  33. package/js/StyleContextStack.js +48 -48
  34. package/js/TableProcessor.js +15 -5
  35. package/js/TextBreaker.js +17 -17
  36. package/js/TextInlines.js +33 -33
  37. package/js/URLResolver.js +3 -1
  38. package/js/base.js +4 -4
  39. package/js/browser-extensions/OutputDocumentBrowser.js +24 -24
  40. package/js/columnCalculator.js +2 -2
  41. package/js/helpers/node.js +14 -15
  42. package/js/helpers/variableType.js +18 -18
  43. package/js/qrEnc.js +38 -38
  44. package/js/virtual-fs.js +11 -11
  45. package/package.json +10 -10
  46. package/src/3rd-party/svg-to-pdfkit/LICENSE +9 -9
  47. package/src/3rd-party/svg-to-pdfkit/source.js +2745 -2745
  48. package/src/3rd-party/svg-to-pdfkit.js +3 -3
  49. package/src/DocMeasure.js +749 -745
  50. package/src/DocPreprocessor.js +283 -283
  51. package/src/DocumentContext.js +579 -338
  52. package/src/ElementWriter.js +441 -417
  53. package/src/LayoutBuilder.js +1470 -1262
  54. package/src/Line.js +114 -114
  55. package/src/OutputDocument.js +64 -64
  56. package/src/OutputDocumentServer.js +32 -32
  57. package/src/PDFDocument.js +174 -174
  58. package/src/PageElementWriter.js +306 -179
  59. package/src/PageSize.js +53 -53
  60. package/src/Printer.js +306 -306
  61. package/src/Renderer.js +458 -409
  62. package/src/SVGMeasure.js +109 -109
  63. package/src/StyleContextStack.js +208 -208
  64. package/src/TableProcessor.js +616 -602
  65. package/src/TextBreaker.js +168 -168
  66. package/src/TextDecorator.js +175 -175
  67. package/src/TextInlines.js +224 -224
  68. package/src/URLResolver.js +43 -43
  69. package/src/base.js +70 -70
  70. package/src/browser-extensions/OutputDocumentBrowser.js +80 -80
  71. package/src/browser-extensions/fonts/Roboto.js +27 -27
  72. package/src/browser-extensions/index.js +55 -55
  73. package/src/browser-extensions/pdfMake.js +1 -1
  74. package/src/browser-extensions/standard-fonts/Courier.js +27 -27
  75. package/src/browser-extensions/standard-fonts/Helvetica.js +27 -27
  76. package/src/browser-extensions/standard-fonts/Symbol.js +21 -21
  77. package/src/browser-extensions/standard-fonts/Times.js +27 -27
  78. package/src/browser-extensions/standard-fonts/ZapfDingbats.js +21 -21
  79. package/src/browser-extensions/virtual-fs-cjs.js +1 -1
  80. package/src/columnCalculator.js +154 -154
  81. package/src/helpers/node.js +134 -136
  82. package/src/helpers/tools.js +44 -44
  83. package/src/helpers/variableType.js +50 -50
  84. package/src/index.js +16 -16
  85. package/src/qrEnc.js +796 -796
  86. package/src/standardPageSizes.js +52 -52
  87. package/src/tableLayouts.js +100 -100
  88. package/src/virtual-fs.js +66 -66
  89. package/standard-fonts/Courier.js +8 -8
  90. package/standard-fonts/Helvetica.js +8 -8
  91. package/standard-fonts/Symbol.js +5 -5
  92. package/standard-fonts/Times.js +8 -8
  93. package/standard-fonts/ZapfDingbats.js +5 -5
package/CHANGELOG.md CHANGED
@@ -1,10 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.5 - 2026-02-22
4
+
5
+ - Added `snakingColumns` property for columns to enable newspaper-like column flow
6
+ - Added outlines / bookmarks for `text` node
7
+ - `outline` - set to `true` for add to bookmarks
8
+ - `outlineText` (optional) - set custom bookmark text, otherwise text from node
9
+ - `outlineExpanded` (optional) - set to `true` for expanded/opened bookmark
10
+ - `outlineParentId` (optional) - parent bookmark `id`
11
+ - Added property `outlines` for ToC, which adds all items to outlines / bookmarks (any existing outline settings on texts are respected)
12
+
13
+ ## 0.3.4 - 2026-02-13
14
+
15
+ - Added vertical alignment for table cells via `verticalAlignment` property, values: `top` (default), `middle`, `bottom`
16
+ - Fixed margin inheritance when styles are extended multiple times
17
+
3
18
  ## 0.3.3 - 2026-01-18
4
19
 
5
20
  - Added properties for ToC:
6
21
  - `hideEmpty` - set to `true` if you can hide an empty ToC
7
- - `sortBy` - `'page'` (default) or `'title'`
22
+ - `sortBy` - `'page'` (default) or `'title'`
8
23
  - `sortLocale` - custom locale to sort by property `sortBy`
9
24
  - Added property `decorationThickness` for `text` to set width of the decoration line
10
25
  - Added inherited/extends styles, use property `extends` in style with style name or array of string with style names
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2014-2015 bpampuch
4
- 2016-2026 liborm85
5
-
6
- Permission is hereby granted, free of charge, to any person obtaining a copy of
7
- this software and associated documentation files (the "Software"), to deal in
8
- the Software without restriction, including without limitation the rights to
9
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10
- the Software, and to permit persons to whom the Software is furnished to do so,
11
- subject to the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be included in all
14
- copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014-2015 bpampuch
4
+ 2016-2026 liborm85
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
7
+ this software and associated documentation files (the "Software"), to deal in
8
+ the Software without restriction, including without limitation the rights to
9
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10
+ the Software, and to permit persons to whom the Software is furnished to do so,
11
+ subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,78 +1,76 @@
1
- # pdfmake [![Node.js CI][githubactions_img]][githubactions_url] [![GitHub][github_img]][github_url] [![npm][npm_img]][npm_url] [![CDNJS][cdnjs_img]][cndjs_url]
2
-
3
- [githubactions_img]: https://github.com/bpampuch/pdfmake/actions/workflows/node.js.yml/badge.svg?branch=master
4
- [githubactions_url]: https://github.com/bpampuch/pdfmake/actions
5
-
6
- [github_img]: https://img.shields.io/github/release/bpampuch/pdfmake.svg?colorB=0E7FBF
7
- [github_url]: https://github.com/bpampuch/pdfmake/releases/latest
8
-
9
- [npm_img]: https://img.shields.io/npm/v/pdfmake.svg?colorB=0E7FBF
10
- [npm_url]: https://www.npmjs.com/package/pdfmake
11
-
12
- [cdnjs_img]: https://img.shields.io/cdnjs/v/pdfmake.svg?colorB=0E7FBF
13
- [cndjs_url]: https://cdnjs.com/libraries/pdfmake
14
-
15
-
16
- PDF document generation library for server-side and client-side in pure JavaScript.
17
-
18
- Check out [the playground](http://bpampuch.github.io/pdfmake/playground.html) and [examples](https://github.com/bpampuch/pdfmake/tree/master/examples).
19
-
20
- ### Features
21
-
22
- * line-wrapping,
23
- * text-alignments (left, right, centered, justified),
24
- * numbered and bulleted lists,
25
- * tables and columns
26
- * auto/fixed/star-sized widths,
27
- * col-spans and row-spans,
28
- * headers automatically repeated in case of a page-break,
29
- * images and vector graphics,
30
- * convenient styling and style inheritance,
31
- * page headers and footers:
32
- * static or dynamic content,
33
- * access to current page number and page count,
34
- * background-layer,
35
- * page dimensions and orientations,
36
- * margins,
37
- * document sections,
38
- * custom page breaks,
39
- * font embedding,
40
- * support for complex, multi-level (nested) structures,
41
- * table of contents,
42
- * helper methods for opening/printing/downloading the generated PDF,
43
- * setting of PDF metadata (e.g. author, subject).
44
-
45
- ## Documentation
46
-
47
- **Documentation URL: https://pdfmake.github.io/docs/**
48
-
49
- Source of documentation: https://github.com/pdfmake/docs **Improvements are welcome!**
50
-
51
- ## Building from sources
52
-
53
- using npm:
54
- ```
55
- git clone https://github.com/bpampuch/pdfmake.git
56
- cd pdfmake
57
- npm install
58
- npm run build
59
- ```
60
-
61
- using yarn:
62
- ```
63
- git clone https://github.com/bpampuch/pdfmake.git
64
- cd pdfmake
65
- yarn
66
- yarn run build
67
- ```
68
-
69
- ## License
70
- MIT
71
-
72
- ## Authors
73
- * [@bpampuch](https://github.com/bpampuch) (founder)
74
- * [@liborm85](https://github.com/liborm85)
75
-
76
- pdfmake is based on a truly amazing library [pdfkit](https://github.com/devongovett/pdfkit) (credits to [@devongovett](https://github.com/devongovett)).
77
-
78
- Thanks to all contributors.
1
+ # pdfmake [![Node.js CI][githubactions_img]][githubactions_url] [![GitHub][github_img]][github_url] [![npm][npm_img]][npm_url]
2
+
3
+ [githubactions_img]: https://github.com/bpampuch/pdfmake/actions/workflows/node.js.yml/badge.svg?branch=master
4
+ [githubactions_url]: https://github.com/bpampuch/pdfmake/actions
5
+
6
+ [github_img]: https://img.shields.io/github/release/bpampuch/pdfmake.svg?colorB=0E7FBF
7
+ [github_url]: https://github.com/bpampuch/pdfmake/releases/latest
8
+
9
+ [npm_img]: https://img.shields.io/npm/v/pdfmake.svg?colorB=0E7FBF
10
+ [npm_url]: https://www.npmjs.com/package/pdfmake
11
+
12
+
13
+ PDF document generation library for server-side and client-side in pure JavaScript.
14
+
15
+ Check out [the playground](http://bpampuch.github.io/pdfmake/playground.html) and [examples](https://github.com/bpampuch/pdfmake/tree/master/examples).
16
+
17
+ ### Features
18
+
19
+ * line-wrapping,
20
+ * text-alignments (left, right, centered, justified),
21
+ * numbered and bulleted lists,
22
+ * tables and columns
23
+ * auto/fixed/star-sized widths,
24
+ * col-spans and row-spans,
25
+ * headers automatically repeated in case of a page-break,
26
+ * snaking columns (newspaper-style layout where content flows column-to-column),
27
+ * images and vector graphics,
28
+ * convenient styling and style inheritance,
29
+ * page headers and footers:
30
+ * static or dynamic content,
31
+ * access to current page number and page count,
32
+ * background-layer,
33
+ * page dimensions and orientations,
34
+ * margins,
35
+ * document sections,
36
+ * custom page breaks,
37
+ * font embedding,
38
+ * support for complex, multi-level (nested) structures,
39
+ * table of contents,
40
+ * helper methods for opening/printing/downloading the generated PDF,
41
+ * setting of PDF metadata (e.g. author, subject).
42
+
43
+ ## Documentation
44
+
45
+ **Documentation URL: https://pdfmake.github.io/docs/**
46
+
47
+ Source of documentation: https://github.com/pdfmake/docs **Improvements are welcome!**
48
+
49
+ ## Building from sources
50
+
51
+ using npm:
52
+ ```
53
+ git clone https://github.com/bpampuch/pdfmake.git
54
+ cd pdfmake
55
+ npm install
56
+ npm run build
57
+ ```
58
+
59
+ using yarn:
60
+ ```
61
+ git clone https://github.com/bpampuch/pdfmake.git
62
+ cd pdfmake
63
+ yarn
64
+ yarn run build
65
+ ```
66
+
67
+ ## License
68
+ MIT
69
+
70
+ ## Authors
71
+ * [@bpampuch](https://github.com/bpampuch) (founder)
72
+ * [@liborm85](https://github.com/liborm85)
73
+
74
+ pdfmake is based on a truly amazing library [pdfkit](https://github.com/devongovett/pdfkit) (credits to [@devongovett](https://github.com/devongovett)).
75
+
76
+ Thanks to all contributors.