pdfmake-rtl 1.3.6 → 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.
Files changed (141) hide show
  1. package/.vscode/tasks.json +16 -16
  2. package/CHANGELOG.md +97 -52
  3. package/README.md +252 -753
  4. package/build/fonts/Cairo/Cairo-Black.ttf +0 -0
  5. package/build/fonts/Cairo/Cairo-Bold.ttf +0 -0
  6. package/build/fonts/Cairo/Cairo-ExtraLight.ttf +0 -0
  7. package/build/fonts/Cairo/Cairo-Light.ttf +0 -0
  8. package/build/fonts/Cairo/Cairo-Regular.ttf +0 -0
  9. package/build/fonts/Cairo/Cairo-SemiBold.ttf +0 -0
  10. package/build/fonts/Cairo.js +27 -0
  11. package/build/fonts/Roboto/Roboto-Italic.ttf +0 -0
  12. package/build/fonts/Roboto/Roboto-Medium.ttf +0 -0
  13. package/build/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
  14. package/build/fonts/Roboto/Roboto-Regular.ttf +0 -0
  15. package/build/fonts/Roboto.js +27 -0
  16. package/build/pdfmake.js +62972 -70526
  17. package/build/pdfmake.js.map +1 -1
  18. package/build/pdfmake.min.js +2 -2
  19. package/build/pdfmake.min.js.map +1 -1
  20. package/build/standard-fonts/Courier.js +27 -0
  21. package/build/standard-fonts/Helvetica.js +27 -0
  22. package/build/standard-fonts/Symbol.js +21 -0
  23. package/build/standard-fonts/Times.js +27 -0
  24. package/build/standard-fonts/ZapfDingbats.js +21 -0
  25. package/build/vfs_fonts.js +11 -7
  26. package/build-vfs.js +3 -3
  27. package/fonts/Cairo/Cairo-Black.ttf +0 -0
  28. package/fonts/Cairo/Cairo-Bold.ttf +0 -0
  29. package/fonts/Cairo/Cairo-ExtraLight.ttf +0 -0
  30. package/fonts/Cairo/Cairo-Light.ttf +0 -0
  31. package/fonts/Cairo/Cairo-Regular.ttf +0 -0
  32. package/fonts/Cairo/Cairo-SemiBold.ttf +0 -0
  33. package/fonts/Cairo.js +8 -0
  34. package/fonts/Roboto/Roboto-Italic.ttf +0 -0
  35. package/fonts/Roboto/Roboto-Medium.ttf +0 -0
  36. package/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
  37. package/fonts/Roboto/Roboto-Regular.ttf +0 -0
  38. package/fonts/Roboto.js +8 -0
  39. package/js/3rd-party/svg-to-pdfkit/source.js +3823 -0
  40. package/js/3rd-party/svg-to-pdfkit.js +7 -0
  41. package/js/OutputDocument.js +64 -0
  42. package/js/OutputDocumentServer.js +29 -0
  43. package/js/PDFDocument.js +144 -0
  44. package/js/PageSize.js +74 -0
  45. package/js/Renderer.js +417 -0
  46. package/js/TextBreaker.js +166 -0
  47. package/js/TextInlines.js +244 -0
  48. package/js/URLResolver.js +43 -0
  49. package/js/base.js +59 -0
  50. package/js/browser-extensions/OutputDocumentBrowser.js +82 -0
  51. package/js/browser-extensions/fonts/Cairo.js +38 -0
  52. package/js/browser-extensions/fonts/Roboto.js +38 -0
  53. package/js/browser-extensions/index.js +59 -0
  54. package/js/browser-extensions/pdfMake.js +3 -0
  55. package/js/browser-extensions/standard-fonts/Courier.js +38 -0
  56. package/js/browser-extensions/standard-fonts/Helvetica.js +38 -0
  57. package/js/browser-extensions/standard-fonts/Symbol.js +23 -0
  58. package/js/browser-extensions/standard-fonts/Times.js +38 -0
  59. package/js/browser-extensions/standard-fonts/ZapfDingbats.js +23 -0
  60. package/js/browser-extensions/virtual-fs-cjs.js +3 -0
  61. package/js/columnCalculator.js +148 -0
  62. package/js/docMeasure.js +713 -0
  63. package/js/docPreprocessor.js +275 -0
  64. package/js/documentContext.js +310 -0
  65. package/js/elementWriter.js +687 -0
  66. package/js/helpers/node.js +123 -0
  67. package/js/helpers/tools.js +46 -0
  68. package/js/helpers/variableType.js +59 -0
  69. package/js/index.js +15 -0
  70. package/js/layoutBuilder.js +1227 -0
  71. package/js/line.js +113 -0
  72. package/js/pageElementWriter.js +161 -0
  73. package/js/printer.js +351 -0
  74. package/js/qrEnc.js +721 -0
  75. package/js/rtlUtils.js +516 -0
  76. package/js/standardPageSizes.js +56 -0
  77. package/js/styleContextStack.js +191 -0
  78. package/js/svgMeasure.js +92 -0
  79. package/js/tableLayouts.js +98 -0
  80. package/js/tableProcessor.js +562 -0
  81. package/js/textDecorator.js +152 -0
  82. package/js/virtual-fs.js +60 -0
  83. package/package.json +43 -42
  84. package/src/3rd-party/svg-to-pdfkit/LICENSE +9 -9
  85. package/src/3rd-party/svg-to-pdfkit/source.js +229 -36
  86. package/src/3rd-party/svg-to-pdfkit.js +2 -2
  87. package/src/OutputDocument.js +64 -0
  88. package/src/OutputDocumentServer.js +32 -0
  89. package/src/PDFDocument.js +174 -0
  90. package/src/PageSize.js +53 -0
  91. package/src/Renderer.js +445 -0
  92. package/src/TextBreaker.js +168 -0
  93. package/src/TextInlines.js +263 -0
  94. package/src/URLResolver.js +43 -0
  95. package/src/base.js +70 -0
  96. package/src/browser-extensions/OutputDocumentBrowser.js +80 -0
  97. package/src/browser-extensions/fonts/Cairo.js +27 -0
  98. package/src/browser-extensions/fonts/Roboto.js +27 -0
  99. package/src/browser-extensions/index.js +61 -0
  100. package/src/browser-extensions/pdfMake.js +1 -355
  101. package/src/browser-extensions/standard-fonts/Courier.js +27 -0
  102. package/src/browser-extensions/standard-fonts/Helvetica.js +27 -0
  103. package/src/browser-extensions/standard-fonts/Symbol.js +21 -0
  104. package/src/browser-extensions/standard-fonts/Times.js +27 -0
  105. package/src/browser-extensions/standard-fonts/ZapfDingbats.js +21 -0
  106. package/src/browser-extensions/virtual-fs-cjs.js +1 -0
  107. package/src/columnCalculator.js +35 -38
  108. package/src/docMeasure.js +635 -643
  109. package/src/docPreprocessor.js +306 -275
  110. package/src/documentContext.js +248 -243
  111. package/src/elementWriter.js +646 -320
  112. package/src/helpers/node.js +136 -0
  113. package/src/helpers/tools.js +44 -0
  114. package/src/helpers/variableType.js +50 -0
  115. package/src/index.js +16 -0
  116. package/src/layoutBuilder.js +1393 -1145
  117. package/src/line.js +106 -88
  118. package/src/pageElementWriter.js +159 -146
  119. package/src/printer.js +370 -727
  120. package/src/qrEnc.js +21 -16
  121. package/src/rtlUtils.js +500 -540
  122. package/src/standardPageSizes.js +1 -3
  123. package/src/styleContextStack.js +181 -111
  124. package/src/svgMeasure.js +83 -44
  125. package/src/tableLayouts.js +100 -0
  126. package/src/tableProcessor.js +498 -484
  127. package/src/textDecorator.js +136 -118
  128. package/src/virtual-fs.js +66 -0
  129. package/standard-fonts/Courier.js +8 -0
  130. package/standard-fonts/Helvetica.js +8 -0
  131. package/standard-fonts/Symbol.js +5 -0
  132. package/standard-fonts/Times.js +8 -0
  133. package/standard-fonts/ZapfDingbats.js +5 -0
  134. package/src/browser-extensions/URLBrowserResolver.js +0 -96
  135. package/src/browser-extensions/virtual-fs.js +0 -55
  136. package/src/fontProvider.js +0 -68
  137. package/src/helpers.js +0 -138
  138. package/src/imageMeasure.js +0 -62
  139. package/src/pdfKitEngine.js +0 -21
  140. package/src/textTools.js +0 -391
  141. package/src/traversalTracker.js +0 -47
@@ -1,17 +1,17 @@
1
- {
2
- "version": "2.0.0",
3
- "tasks": [
4
- {
5
- "label": "run tests",
6
- "type": "shell",
7
- "command": "npm",
8
- "args": [
9
- "test"
10
- ],
11
- "problemMatcher": [
12
- "$eslint-stylish"
13
- ],
14
- "group": "build"
15
- }
16
- ]
1
+ {
2
+ "version": "2.0.0",
3
+ "tasks": [
4
+ {
5
+ "label": "run tests",
6
+ "type": "shell",
7
+ "command": "npm",
8
+ "args": [
9
+ "test"
10
+ ],
11
+ "problemMatcher": [
12
+ "$eslint-stylish"
13
+ ],
14
+ "group": "build"
15
+ }
16
+ ]
17
17
  }
package/CHANGELOG.md CHANGED
@@ -1,52 +1,97 @@
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
- ## [1.3.6] - 2025-08-08
9
-
10
- ### Added
11
- - Enhanced RTL table handling with improved column reversal for Arabic, Persian, and Urdu text
12
- - New `reverseTableRowPreserveSpans` function to handle complex table structures with colSpan and rowSpan
13
- - Automatic RTL detection and processing for tables containing RTL content
14
- - Support for preserving table header structure in RTL layouts
15
- - Comprehensive test examples for RTL table scenarios
16
-
17
- ### Improved
18
- - Auto-RTL detection logic now respects explicit `supportRTL: false` setting
19
- - Better handling of nested table headers with mixed span attributes
20
- - Enhanced RTL text processing with proper bidirectional text support
21
- - Improved column reversal algorithm that preserves span relationships
22
-
23
- ### Fixed
24
- - Fixed RTL table header positioning issues with colSpan and rowSpan elements
25
- - Resolved auto-RTL detection overriding explicit RTL settings
26
- - Fixed column ordering in complex nested header structures
27
- - Corrected span placeholder handling in RTL table reversal
28
-
29
- ### Technical Details
30
- - Added `processAutoRTLTable` function for intelligent RTL detection
31
- - Enhanced `rtlUtils.js` with span-aware reversal algorithms
32
- - Improved error handling for empty object placeholders in span structures
33
- - Added comprehensive unit tests for RTL table functionality
34
-
35
- ### Examples Added
36
- - `examples/rtl-nested-header.js` - Demonstrates complex RTL table with nested headers
37
- - `examples/test-simple-rtl-table.js` - Basic RTL table functionality test
38
- - `examples/test-no-spans-rtl-table.js` - RTL table without span elements
39
-
40
- ### Breaking Changes
41
- - None. All changes are backward compatible.
42
-
43
- ### Notes
44
- - RTL detection threshold set to 30% RTL content for automatic table reversal
45
- - Headers with span structures are preserved to maintain layout integrity
46
- - Cell-level RTL text rendering (`bidi: true`) applied automatically for RTL content
47
-
48
- ---
49
-
50
- ## Previous Versions
51
-
52
- This is the first tracked version of the changelog. For earlier changes, please refer to the git commit history.
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.0.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
+ ### Added
33
+
34
+ - Major version upgrade with significant architectural improvements
35
+ - Full rewrite of RTL processing pipeline for better performance and reliability
36
+
37
+ ### Improved
38
+
39
+ - Overall RTL text rendering quality and consistency
40
+ - Performance optimizations for large documents with mixed LTR/RTL content
41
+
42
+ ### Breaking Changes
43
+
44
+ - Major version bump; review migration guide for upgrading from v1.x
45
+
46
+ ## [1.3.6] - 2025-08-08
47
+
48
+ ### Added
49
+
50
+ - Enhanced RTL table handling with improved column reversal for Arabic, Persian, and Urdu text
51
+ - New `reverseTableRowPreserveSpans` function to handle complex table structures with colSpan and rowSpan
52
+ - Automatic RTL detection and processing for tables containing RTL content
53
+ - Support for preserving table header structure in RTL layouts
54
+ - Comprehensive test examples for RTL table scenarios
55
+
56
+ ### Improved
57
+
58
+ - Auto-RTL detection logic now respects explicit `supportRTL: false` setting
59
+ - Better handling of nested table headers with mixed span attributes
60
+ - Enhanced RTL text processing with proper bidirectional text support
61
+ - Improved column reversal algorithm that preserves span relationships
62
+
63
+ ### Fixed
64
+
65
+ - Fixed RTL table header positioning issues with colSpan and rowSpan elements
66
+ - Resolved auto-RTL detection overriding explicit RTL settings
67
+ - Fixed column ordering in complex nested header structures
68
+ - Corrected span placeholder handling in RTL table reversal
69
+
70
+ ### Technical Details
71
+
72
+ - Added `processAutoRTLTable` function for intelligent RTL detection
73
+ - Enhanced `rtlUtils.js` with span-aware reversal algorithms
74
+ - Improved error handling for empty object placeholders in span structures
75
+ - Added comprehensive unit tests for RTL table functionality
76
+
77
+ ### Examples Added
78
+
79
+ - `examples/rtl-nested-header.js` - Demonstrates complex RTL table with nested headers
80
+ - `examples/test-simple-rtl-table.js` - Basic RTL table functionality test
81
+ - `examples/test-no-spans-rtl-table.js` - RTL table without span elements
82
+
83
+ ### Breaking Changes
84
+
85
+ - None. All changes are backward compatible.
86
+
87
+ ### Notes
88
+
89
+ - RTL detection threshold set to 30% RTL content for automatic table reversal
90
+ - Headers with span structures are preserved to maintain layout integrity
91
+ - Cell-level RTL text rendering (`bidi: true`) applied automatically for RTL content
92
+
93
+ ---
94
+
95
+ ## Previous Versions
96
+
97
+ This is the first tracked version of the changelog. For earlier changes, please refer to the git commit history.