@digicole/pdfmake-rtl 1.2.0 → 2.1.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.
- package/.vscode/tasks.json +17 -0
- package/CHANGELOG.md +83 -128
- package/LICENSE +22 -22
- package/README.md +186 -683
- package/build/fonts/Cairo/Cairo-Black.ttf +0 -0
- package/build/fonts/Cairo/Cairo-Bold.ttf +0 -0
- package/build/fonts/Cairo/Cairo-ExtraLight.ttf +0 -0
- package/build/fonts/Cairo/Cairo-Light.ttf +0 -0
- package/build/fonts/Cairo/Cairo-Regular.ttf +0 -0
- package/build/fonts/Cairo/Cairo-SemiBold.ttf +0 -0
- package/build/fonts/Cairo.js +27 -0
- package/build/fonts/Roboto/Roboto-Italic.ttf +0 -0
- package/build/fonts/Roboto/Roboto-Medium.ttf +0 -0
- package/build/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
- package/build/fonts/Roboto/Roboto-Regular.ttf +0 -0
- package/build/fonts/Roboto.js +27 -0
- package/build/pdfmake.js +63736 -71285
- package/build/pdfmake.js.map +1 -1
- package/build/pdfmake.min.js +2 -2
- package/build/pdfmake.min.js.map +1 -1
- package/build/standard-fonts/Courier.js +27 -0
- package/build/standard-fonts/Helvetica.js +27 -0
- package/build/standard-fonts/Symbol.js +21 -0
- package/build/standard-fonts/Times.js +27 -0
- package/build/standard-fonts/ZapfDingbats.js +21 -0
- package/build/vfs_fonts.js +11 -7
- package/build-vfs.js +44 -44
- package/fonts/Cairo/Cairo-Black.ttf +0 -0
- package/fonts/Cairo/Cairo-Bold.ttf +0 -0
- package/fonts/Cairo/Cairo-ExtraLight.ttf +0 -0
- package/fonts/Cairo/Cairo-Light.ttf +0 -0
- package/fonts/Cairo/Cairo-Regular.ttf +0 -0
- package/fonts/Cairo/Cairo-SemiBold.ttf +0 -0
- package/fonts/Cairo.js +8 -0
- package/fonts/Roboto/Roboto-Italic.ttf +0 -0
- package/fonts/Roboto/Roboto-Medium.ttf +0 -0
- package/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
- package/fonts/Roboto/Roboto-Regular.ttf +0 -0
- package/fonts/Roboto.js +8 -0
- package/index.js +26 -26
- package/package.json +42 -39
- package/src/3rd-party/svg-to-pdfkit/LICENSE +9 -9
- package/src/3rd-party/svg-to-pdfkit/source.js +229 -36
- package/src/3rd-party/svg-to-pdfkit.js +3 -3
- package/src/OutputDocument.js +64 -0
- package/src/OutputDocumentServer.js +32 -0
- package/src/PDFDocument.js +174 -0
- package/src/PageSize.js +53 -0
- package/src/Renderer.js +445 -0
- package/src/TextBreaker.js +168 -0
- package/src/TextInlines.js +263 -0
- package/src/URLResolver.js +43 -0
- package/src/base.js +70 -0
- package/src/browser-extensions/OutputDocumentBrowser.js +80 -0
- package/src/browser-extensions/fonts/Cairo.js +27 -0
- package/src/browser-extensions/fonts/Roboto.js +27 -0
- package/src/browser-extensions/index.js +61 -0
- package/src/browser-extensions/pdfMake.js +1 -355
- package/src/browser-extensions/standard-fonts/Courier.js +27 -0
- package/src/browser-extensions/standard-fonts/Helvetica.js +27 -0
- package/src/browser-extensions/standard-fonts/Symbol.js +21 -0
- package/src/browser-extensions/standard-fonts/Times.js +27 -0
- package/src/browser-extensions/standard-fonts/ZapfDingbats.js +21 -0
- package/src/browser-extensions/virtual-fs-cjs.js +1 -0
- package/src/columnCalculator.js +154 -157
- package/src/docMeasure.js +802 -810
- package/src/docPreprocessor.js +306 -273
- package/src/documentContext.js +345 -340
- package/src/elementWriter.js +736 -411
- package/src/helpers/node.js +136 -0
- package/src/helpers/tools.js +44 -0
- package/src/helpers/variableType.js +50 -0
- package/src/index.js +16 -0
- package/src/layoutBuilder.js +1393 -1197
- package/src/line.js +122 -104
- package/src/pageElementWriter.js +187 -174
- package/src/printer.js +370 -727
- package/src/qrEnc.js +796 -791
- package/src/rtlUtils.js +500 -485
- package/src/standardPageSizes.js +52 -54
- package/src/styleContextStack.js +208 -138
- package/src/svgMeasure.js +109 -70
- package/src/tableLayouts.js +100 -0
- package/src/tableProcessor.js +620 -606
- package/src/textDecorator.js +175 -157
- package/src/virtual-fs.js +66 -0
- package/standard-fonts/Courier.js +8 -0
- package/standard-fonts/Helvetica.js +8 -0
- package/standard-fonts/Symbol.js +5 -0
- package/standard-fonts/Times.js +8 -0
- package/standard-fonts/ZapfDingbats.js +5 -0
- package/index.html +0 -396
- package/src/browser-extensions/URLBrowserResolver.js +0 -96
- package/src/browser-extensions/virtual-fs.js +0 -55
- package/src/fontProvider.js +0 -68
- package/src/helpers.js +0 -138
- package/src/imageMeasure.js +0 -62
- package/src/pdfKitEngine.js +0 -21
- package/src/textTools.js +0 -391
- package/src/traversalTracker.js +0 -47
package/CHANGELOG.md
CHANGED
|
@@ -1,128 +1,83 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
- Fixed
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
- Fixed
|
|
52
|
-
-
|
|
53
|
-
- Fixed
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
## 0.2.7 - 2022-12-17
|
|
85
|
-
|
|
86
|
-
- Fixed theoretical vulnerability CVE-2022-46161 (**It was never part of version released as npm package or cdnjs or bower or packagist!**)
|
|
87
|
-
|
|
88
|
-
## 0.2.6 - 2022-10-09
|
|
89
|
-
|
|
90
|
-
- Updated Roboto font (version 3.005)
|
|
91
|
-
- Fixed calculating auto page height
|
|
92
|
-
- Fixed TrueType Collection loading from URL
|
|
93
|
-
- Fixed refetching fonts from URL
|
|
94
|
-
|
|
95
|
-
## 0.2.5 - 2022-04-01
|
|
96
|
-
|
|
97
|
-
- Support passing headers to request for loading font files and images via URL adresses
|
|
98
|
-
|
|
99
|
-
## 0.2.4 - 2021-11-10
|
|
100
|
-
|
|
101
|
-
- Fixed destination path argument in VFS build script.
|
|
102
|
-
- Fixed error "Object.isExtensible is not a function" (bug is in core-js version 3.19.1).
|
|
103
|
-
|
|
104
|
-
## 0.2.3 - 2021-11-06
|
|
105
|
-
|
|
106
|
-
- Updated [@foliojs-fork/pdfkit](https://github.com/foliojs-fork/pdfkit) to version 0.13.0.
|
|
107
|
-
- Tiling pattern support.
|
|
108
|
-
- svg-to-pdfkit package moved as built-in. Solve not used installation of pdfkit.
|
|
109
|
-
- Fixed passing document metadata.
|
|
110
|
-
|
|
111
|
-
## 0.2.2 - 2021-08-02
|
|
112
|
-
|
|
113
|
-
- Fixed compatibility with Internet Explorer 11.
|
|
114
|
-
|
|
115
|
-
## 0.2.1 - 2021-08-02
|
|
116
|
-
|
|
117
|
-
- Upgrade Unicode Line Breaking Algorithm (UAX #14) to Unicode 13.0.0.
|
|
118
|
-
- Updated [@foliojs-fork/pdfkit](https://github.com/foliojs-fork/pdfkit) to version 0.12.3.
|
|
119
|
-
- Updated [@foliojs-fork/linebreak](https://github.com/foliojs-fork/linebreak) to version 1.11.1.
|
|
120
|
-
|
|
121
|
-
## 0.2.0 - 2021-07-05
|
|
122
|
-
|
|
123
|
-
- 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).
|
|
124
|
-
- Upgrade Unicode Line Breaking Algorithm (UAX #14) to Unicode 12.0.0
|
|
125
|
-
- 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/)).
|
|
126
|
-
- Removed support Node.js 8 and 10. Minimum required version is 12 LTS.
|
|
127
|
-
- Removed support Internet Explorer 10. Supported only Internet Explorer 11.
|
|
128
|
-
- Removed gulp.
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [2.1.0] - 2026-02-08
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Major version upgrade with significant architectural improvements
|
|
13
|
+
- Full rewrite of RTL processing pipeline for better performance and reliability
|
|
14
|
+
- Support for RTL list tables with proper right-to-left rendering
|
|
15
|
+
- RTL-aware ordered and unordered list handling within table cells
|
|
16
|
+
|
|
17
|
+
### Improved
|
|
18
|
+
|
|
19
|
+
- Overall RTL text rendering quality and consistency
|
|
20
|
+
- Performance optimizations for large documents with mixed LTR/RTL content
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- Fixed mixed character rendering issues with combined LTR/RTL scripts
|
|
25
|
+
- Fixed mixed language text handling for Arabic, Persian, Urdu alongside Latin characters
|
|
26
|
+
- Corrected bidirectional text reordering in mixed-language paragraphs
|
|
27
|
+
|
|
28
|
+
### Breaking Changes
|
|
29
|
+
|
|
30
|
+
- Major version bump; review migration guide for upgrading from v1.x
|
|
31
|
+
|
|
32
|
+
## [1.3.6] - 2025-08-08
|
|
33
|
+
|
|
34
|
+
### Added
|
|
35
|
+
|
|
36
|
+
- Enhanced RTL table handling with improved column reversal for Arabic, Persian, and Urdu text
|
|
37
|
+
- New `reverseTableRowPreserveSpans` function to handle complex table structures with colSpan and rowSpan
|
|
38
|
+
- Automatic RTL detection and processing for tables containing RTL content
|
|
39
|
+
- Support for preserving table header structure in RTL layouts
|
|
40
|
+
- Comprehensive test examples for RTL table scenarios
|
|
41
|
+
|
|
42
|
+
### Improved
|
|
43
|
+
|
|
44
|
+
- Auto-RTL detection logic now respects explicit `supportRTL: false` setting
|
|
45
|
+
- Better handling of nested table headers with mixed span attributes
|
|
46
|
+
- Enhanced RTL text processing with proper bidirectional text support
|
|
47
|
+
- Improved column reversal algorithm that preserves span relationships
|
|
48
|
+
|
|
49
|
+
### Fixed
|
|
50
|
+
|
|
51
|
+
- Fixed RTL table header positioning issues with colSpan and rowSpan elements
|
|
52
|
+
- Resolved auto-RTL detection overriding explicit RTL settings
|
|
53
|
+
- Fixed column ordering in complex nested header structures
|
|
54
|
+
- Corrected span placeholder handling in RTL table reversal
|
|
55
|
+
|
|
56
|
+
### Technical Details
|
|
57
|
+
|
|
58
|
+
- Added `processAutoRTLTable` function for intelligent RTL detection
|
|
59
|
+
- Enhanced `rtlUtils.js` with span-aware reversal algorithms
|
|
60
|
+
- Improved error handling for empty object placeholders in span structures
|
|
61
|
+
- Added comprehensive unit tests for RTL table functionality
|
|
62
|
+
|
|
63
|
+
### Examples Added
|
|
64
|
+
|
|
65
|
+
- `examples/rtl-nested-header.js` - Demonstrates complex RTL table with nested headers
|
|
66
|
+
- `examples/test-simple-rtl-table.js` - Basic RTL table functionality test
|
|
67
|
+
- `examples/test-no-spans-rtl-table.js` - RTL table without span elements
|
|
68
|
+
|
|
69
|
+
### Breaking Changes
|
|
70
|
+
|
|
71
|
+
- None. All changes are backward compatible.
|
|
72
|
+
|
|
73
|
+
### Notes
|
|
74
|
+
|
|
75
|
+
- RTL detection threshold set to 30% RTL content for automatic table reversal
|
|
76
|
+
- Headers with span structures are preserved to maintain layout integrity
|
|
77
|
+
- Cell-level RTL text rendering (`bidi: true`) applied automatically for RTL content
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Previous Versions
|
|
82
|
+
|
|
83
|
+
This is the first tracked version of the changelog. For earlier changes, please refer to the git commit history.
|
package/LICENSE
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2014-2015 bpampuch (original PDFMake)
|
|
4
|
-
2016-2025 liborm85 (PDFMake maintenance)
|
|
5
|
-
2025 PDFMake RTL Contributors (RTL extensions)
|
|
6
|
-
|
|
7
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
8
|
-
this software and associated documentation files (the "Software"), to deal in
|
|
9
|
-
the Software without restriction, including without limitation the rights to
|
|
10
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
11
|
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
12
|
-
subject to the following conditions:
|
|
13
|
-
|
|
14
|
-
The above copyright notice and this permission notice shall be included in all
|
|
15
|
-
copies or substantial portions of the Software.
|
|
16
|
-
|
|
17
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
19
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
20
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
21
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
22
|
-
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 (original PDFMake)
|
|
4
|
+
2016-2025 liborm85 (PDFMake maintenance)
|
|
5
|
+
2025 PDFMake RTL Contributors (RTL extensions)
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
8
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
9
|
+
the Software without restriction, including without limitation the rights to
|
|
10
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
11
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
12
|
+
subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
19
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
20
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
21
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
22
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|