pdfmake 0.3.0-beta.8 → 0.3.0

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 (87) hide show
  1. package/CHANGELOG.md +7 -40
  2. package/LICENSE +1 -1
  3. package/README.md +78 -85
  4. package/build/pdfmake.js +60308 -68400
  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 +4 -4
  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 +3626 -0
  14. package/js/3rd-party/svg-to-pdfkit.js +7 -0
  15. package/js/DocMeasure.js +645 -0
  16. package/js/DocPreprocessor.js +253 -0
  17. package/js/DocumentContext.js +305 -0
  18. package/js/ElementWriter.js +354 -0
  19. package/js/LayoutBuilder.js +1105 -0
  20. package/js/Line.js +105 -0
  21. package/js/OutputDocument.js +64 -0
  22. package/js/OutputDocumentServer.js +22 -0
  23. package/js/PDFDocument.js +144 -0
  24. package/js/PageElementWriter.js +155 -0
  25. package/js/PageSize.js +74 -0
  26. package/js/Printer.js +291 -0
  27. package/js/Renderer.js +383 -0
  28. package/js/SVGMeasure.js +69 -0
  29. package/js/StyleContextStack.js +168 -0
  30. package/js/TableProcessor.js +548 -0
  31. package/js/TextBreaker.js +166 -0
  32. package/js/TextDecorator.js +143 -0
  33. package/js/TextInlines.js +206 -0
  34. package/js/URLResolver.js +43 -0
  35. package/js/base.js +52 -0
  36. package/js/browser-extensions/OutputDocumentBrowser.js +81 -0
  37. package/js/browser-extensions/fonts/Roboto.js +38 -0
  38. package/js/browser-extensions/index.js +53 -0
  39. package/js/browser-extensions/pdfMake.js +3 -0
  40. package/js/browser-extensions/standard-fonts/Courier.js +38 -0
  41. package/js/browser-extensions/standard-fonts/Helvetica.js +38 -0
  42. package/js/browser-extensions/standard-fonts/Symbol.js +23 -0
  43. package/js/browser-extensions/standard-fonts/Times.js +38 -0
  44. package/js/browser-extensions/standard-fonts/ZapfDingbats.js +23 -0
  45. package/js/browser-extensions/virtual-fs-cjs.js +3 -0
  46. package/js/columnCalculator.js +148 -0
  47. package/js/helpers/node.js +98 -0
  48. package/js/helpers/tools.js +46 -0
  49. package/js/helpers/variableType.js +59 -0
  50. package/js/index.js +15 -0
  51. package/js/qrEnc.js +721 -0
  52. package/js/standardPageSizes.js +56 -0
  53. package/js/tableLayouts.js +98 -0
  54. package/js/virtual-fs.js +60 -0
  55. package/package.json +25 -24
  56. package/src/DocMeasure.js +28 -7
  57. package/src/DocPreprocessor.js +25 -6
  58. package/src/DocumentContext.js +62 -33
  59. package/src/ElementWriter.js +30 -7
  60. package/src/LayoutBuilder.js +557 -120
  61. package/src/OutputDocument.js +23 -37
  62. package/src/OutputDocumentServer.js +6 -11
  63. package/src/PDFDocument.js +1 -1
  64. package/src/PageElementWriter.js +21 -2
  65. package/src/Printer.js +134 -131
  66. package/src/Renderer.js +13 -15
  67. package/src/SVGMeasure.js +2 -2
  68. package/src/StyleContextStack.js +7 -44
  69. package/src/TableProcessor.js +62 -22
  70. package/src/TextBreaker.js +24 -5
  71. package/src/TextInlines.js +1 -1
  72. package/src/URLResolver.js +24 -58
  73. package/src/base.js +1 -1
  74. package/src/browser-extensions/OutputDocumentBrowser.js +33 -71
  75. package/src/browser-extensions/index.js +3 -3
  76. package/src/browser-extensions/pdfMake.js +0 -14
  77. package/src/browser-extensions/standard-fonts/Courier.js +4 -4
  78. package/src/browser-extensions/standard-fonts/Helvetica.js +4 -4
  79. package/src/browser-extensions/standard-fonts/Symbol.js +1 -1
  80. package/src/browser-extensions/standard-fonts/Times.js +4 -4
  81. package/src/browser-extensions/standard-fonts/ZapfDingbats.js +1 -1
  82. package/src/columnCalculator.js +24 -3
  83. package/src/helpers/tools.js +5 -0
  84. package/src/helpers/variableType.js +11 -0
  85. package/src/index.js +1 -1
  86. package/standard-fonts/Helvetica.js +0 -1
  87. package/src/browser-extensions/URLBrowserResolver.js +0 -84
package/CHANGELOG.md CHANGED
@@ -1,49 +1,16 @@
1
1
  # Changelog
2
2
 
3
- ## 0.3.0-beta.8 - 2024-03-07
4
-
5
- - Removed unused brfs dependency
6
-
7
- ## 0.3.0-beta.7 - 2024-01-01
8
-
9
- - Minimal supported version Node.js 16 LTS
10
- - Added padding option for QR code
11
- - Allow the document language to be specified
12
- - Fixed cover image size inside table
13
- - Fixed "Cannot read properties of undefined (reading 'bottomMost')" if table contains too few rows
14
- - Fixed invalid source-maps in builded js file
15
-
16
- ## 0.3.0-beta.6 - 2023-11-09
17
-
18
- - Update pdfkit to 0.14.0
19
- - Update Roboto font (version 3.008)
20
-
21
- ## 0.3.0-beta.5 - 2023-02-19
22
-
23
- - Fixed document buffer size. Node.js 18+ allow max 1 GiB.
24
-
25
- ## 0.3.0-beta.4 - 2022-12-17
26
-
27
- - Minimal supported version Node.js 14 LTS
28
- - Fixed theoretical vulnerability CVE-2022-46161 (**It was never part of version released as npm package or cdnjs or bower or packagist!**)
29
-
30
- ## 0.3.0-beta.3 - 2022-10-09
31
-
32
- - Updated Roboto font (version 3.005)
33
- - Fixed calculating auto page height
34
- - Fixed TrueType Collection loading from URL
35
- - Fixed refetching fonts from URL
36
-
37
- ## 0.3.0-beta.2 - 2022-04-01
38
-
39
- - Attachments embedding
40
- - Support passing headers to request for loading font files and images via URL adresses
41
-
42
- ## 0.3.0-beta.1 - 2022-01-01
3
+ ## 0.3.0 - 2026-01-01
43
4
 
5
+ - Reverted to the original `pdfkit` package, moving away from `@foliojs-fork`
6
+ - Drop support Internet Explorer 11 (Microsoft will not support from 2022)
7
+ - Minimal supported version Node.js 20 LTS
44
8
  - Port code base to ES6+
45
9
  - Unify interface for node and browser **(breaking change)**
46
10
  - All methods return promise instead of using callback **(breaking change)**
47
11
  - Change including virtual font storage in client-side **(breaking change)**
48
12
  - Change parameters of `pageBreakBefore` function **(breaking change)**
49
13
  - Support for loading font files and images via URL adresses (https:// or http:// protocol) in Node.js (client and server side now)
14
+ - Used fetch API for downloading fonts and images
15
+ - Attachments embedding
16
+ - Added `section` node
package/LICENSE CHANGED
@@ -1,7 +1,7 @@
1
1
  The MIT License (MIT)
2
2
 
3
3
  Copyright (c) 2014-2015 bpampuch
4
- 2016-2024 liborm85
4
+ 2016-2026 liborm85
5
5
 
6
6
  Permission is hereby granted, free of charge, to any person obtaining a copy of
7
7
  this software and associated documentation files (the "Software"), to deal in
package/README.md CHANGED
@@ -1,85 +1,78 @@
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
-
3
- [githubactions_img]: https://github.com/bpampuch/pdfmake/workflows/Node.js%20CI/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
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
- [bower_img]: https://img.shields.io/bower/v/pdfmake.svg?colorB=0E7FBF
13
- [bower_url]: https://github.com/bpampuch/pdfmake
14
-
15
- [packagist_img]: https://img.shields.io/packagist/v/bpampuch/pdfmake.svg?colorB=0E7FBF
16
- [packagist_url]: https://packagist.org/packages/bpampuch/pdfmake
17
-
18
- [cdnjs_img]: https://img.shields.io/cdnjs/v/pdfmake.svg?colorB=0E7FBF
19
- [cndjs_url]: https://cdnjs.com/libraries/pdfmake
20
-
21
-
22
- PDF document generation library for server-side and client-side in pure JavaScript.
23
-
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).
27
-
28
- ### Features
29
-
30
- * line-wrapping,
31
- * text-alignments (left, right, centered, justified),
32
- * numbered and bulleted lists,
33
- * tables and columns
34
- * auto/fixed/star-sized widths,
35
- * col-spans and row-spans,
36
- * headers automatically repeated in case of a page-break,
37
- * images and vector graphics,
38
- * convenient styling and style inheritance,
39
- * page headers and footers:
40
- * static or dynamic content,
41
- * access to current page number and page count,
42
- * background-layer,
43
- * page dimensions and orientations,
44
- * margins,
45
- * custom page breaks,
46
- * font embedding,
47
- * support for complex, multi-level (nested) structures,
48
- * table of contents,
49
- * helper methods for opening/printing/downloading the generated PDF,
50
- * setting of PDF metadata (e.g. author, subject).
51
-
52
- ## Documentation
53
-
54
- **Documentation URL: https://pdfmake.github.io/docs/**
55
-
56
- Source of documentation: https://github.com/pdfmake/docs **Improvements are welcome!**
57
-
58
- ## Building from sources
59
-
60
- using npm:
61
- ```
62
- git clone https://github.com/bpampuch/pdfmake.git
63
- cd pdfmake
64
- npm install
65
- npm run build
66
- ```
67
-
68
- using yarn:
69
- ```
70
- git clone https://github.com/bpampuch/pdfmake.git
71
- cd pdfmake
72
- yarn
73
- yarn run build
74
- ```
75
-
76
- ## License
77
- MIT
78
-
79
- ## Authors
80
- * [@bpampuch](https://github.com/bpampuch) (founder)
81
- * [@liborm85](https://github.com/liborm85)
82
-
83
- pdfmake is based on a truly amazing library [pdfkit](https://github.com/devongovett/pdfkit) (credits to [@devongovett](https://github.com/devongovett)).
84
-
85
- Thanks to all contributors.
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.