@digicole/pdfmake-rtl 2.1.0 → 2.1.2
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/CHANGELOG.md +118 -83
- package/README.md +11 -10
- package/build/pdfmake.js +71 -42
- package/build/pdfmake.js.map +1 -1
- package/build/pdfmake.min.js +2 -2
- package/build/pdfmake.min.js.map +1 -1
- package/build/vfs_fonts.js +11 -11
- package/js/3rd-party/svg-to-pdfkit/source.js +3823 -0
- package/js/3rd-party/svg-to-pdfkit.js +7 -0
- package/js/DocMeasure.js +713 -0
- package/js/DocPreprocessor.js +275 -0
- package/js/DocumentContext.js +310 -0
- package/js/ElementWriter.js +687 -0
- package/js/LayoutBuilder.js +1240 -0
- package/js/Line.js +113 -0
- package/js/OutputDocument.js +64 -0
- package/js/OutputDocumentServer.js +29 -0
- package/js/PDFDocument.js +144 -0
- package/js/PageElementWriter.js +161 -0
- package/js/PageSize.js +74 -0
- package/js/Printer.js +351 -0
- package/js/Renderer.js +417 -0
- package/js/SVGMeasure.js +92 -0
- package/js/StyleContextStack.js +191 -0
- package/js/TableProcessor.js +575 -0
- package/js/TextBreaker.js +166 -0
- package/js/TextDecorator.js +152 -0
- package/js/TextInlines.js +244 -0
- package/js/URLResolver.js +43 -0
- package/js/base.js +59 -0
- package/js/browser-extensions/OutputDocumentBrowser.js +82 -0
- package/js/browser-extensions/fonts/Cairo.js +38 -0
- package/js/browser-extensions/fonts/Roboto.js +38 -0
- package/js/browser-extensions/index.js +59 -0
- package/js/browser-extensions/pdfMake.js +3 -0
- package/js/browser-extensions/standard-fonts/Courier.js +38 -0
- package/js/browser-extensions/standard-fonts/Helvetica.js +38 -0
- package/js/browser-extensions/standard-fonts/Symbol.js +23 -0
- package/js/browser-extensions/standard-fonts/Times.js +38 -0
- package/js/browser-extensions/standard-fonts/ZapfDingbats.js +23 -0
- package/js/browser-extensions/virtual-fs-cjs.js +3 -0
- package/js/columnCalculator.js +148 -0
- package/js/helpers/node.js +123 -0
- package/js/helpers/tools.js +46 -0
- package/js/helpers/variableType.js +59 -0
- package/js/index.js +15 -0
- package/js/qrEnc.js +721 -0
- package/js/rtlUtils.js +519 -0
- package/js/standardPageSizes.js +56 -0
- package/js/tableLayouts.js +98 -0
- package/js/virtual-fs.js +60 -0
- package/package.json +1 -1
- package/src/{docMeasure.js → DocMeasure.js} +8 -8
- package/src/{elementWriter.js → ElementWriter.js} +3 -3
- package/src/{layoutBuilder.js → LayoutBuilder.js} +1406 -1393
- package/src/{tableProcessor.js → TableProcessor.js} +633 -620
- package/src/rtlUtils.js +503 -500
- /package/src/{docPreprocessor.js → DocPreprocessor.js} +0 -0
- /package/src/{documentContext.js → DocumentContext.js} +0 -0
- /package/src/{line.js → Line.js} +0 -0
- /package/src/{pageElementWriter.js → PageElementWriter.js} +0 -0
- /package/src/{printer.js → Printer.js} +0 -0
- /package/src/{svgMeasure.js → SVGMeasure.js} +0 -0
- /package/src/{styleContextStack.js → StyleContextStack.js} +0 -0
- /package/src/{textDecorator.js → TextDecorator.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,83 +1,118 @@
|
|
|
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.
|
|
9
|
-
|
|
10
|
-
### Added
|
|
11
|
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
-
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
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.2] - 2026-02-10
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- RTL table grid right-alignment: tables with `rtl: true` or auto-detected RTL now draw borders and grid lines starting from the right side of the page
|
|
13
|
+
- Internal `_rtl` flag on table nodes for the drawing phase (`TableProcessor` / `LayoutBuilder`)
|
|
14
|
+
- New RTL table example in `examples/tables-rtl.js` demonstrating right-aligned grid
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- Package renamed from `pdfmake-rtl` to `@digicole/pdfmake-rtl` (scoped npm package)
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- Fixed RTL tables with `widths: ['auto', …]` rendering their grid/borders flush-left instead of flush-right
|
|
23
|
+
- `TableProcessor.beginTable()` now shifts `rowSpanData` positions right by the unused space for RTL tables
|
|
24
|
+
- `LayoutBuilder.processRow()` now shifts `context.x` right so cell content aligns with the right-aligned grid
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## [2.1.1] - 2026-02-10
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
|
|
32
|
+
- Browser example `examples/simple-rtl-table.html` for quick RTL testing in the browser
|
|
33
|
+
- README quick-start sections for Node.js and browser usage
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
|
|
37
|
+
- Complete rewrite of `adjustRTLInlines()` with proper bidi-like run-based reordering (7-step algorithm) for correct punctuation placement in mixed RTL/LTR text
|
|
38
|
+
- Stack-based balanced bracket pair detection with UBA Rule L4 mirroring for parentheses in RTL context
|
|
39
|
+
- Brackets adjacent to numbers or LTR text are now preserved correctly (e.g. `1)` stays as `1)`)
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## [2.1.0] - 2026-02-08
|
|
44
|
+
|
|
45
|
+
### Added
|
|
46
|
+
|
|
47
|
+
- Major version upgrade with significant architectural improvements
|
|
48
|
+
- Full rewrite of RTL processing pipeline for better performance and reliability
|
|
49
|
+
- Support for RTL list tables with proper right-to-left rendering
|
|
50
|
+
- RTL-aware ordered and unordered list handling within table cells
|
|
51
|
+
|
|
52
|
+
### Improved
|
|
53
|
+
|
|
54
|
+
- Overall RTL text rendering quality and consistency
|
|
55
|
+
- Performance optimizations for large documents with mixed LTR/RTL content
|
|
56
|
+
|
|
57
|
+
### Fixed
|
|
58
|
+
|
|
59
|
+
- Fixed mixed character rendering issues with combined LTR/RTL scripts
|
|
60
|
+
- Fixed mixed language text handling for Arabic, Persian, Urdu alongside Latin characters
|
|
61
|
+
- Corrected bidirectional text reordering in mixed-language paragraphs
|
|
62
|
+
|
|
63
|
+
### Breaking Changes
|
|
64
|
+
|
|
65
|
+
- Major version bump; review migration guide for upgrading from v1.x
|
|
66
|
+
|
|
67
|
+
## [1.3.6] - 2025-08-08
|
|
68
|
+
|
|
69
|
+
### Added
|
|
70
|
+
|
|
71
|
+
- Enhanced RTL table handling with improved column reversal for Arabic, Persian, and Urdu text
|
|
72
|
+
- New `reverseTableRowPreserveSpans` function to handle complex table structures with colSpan and rowSpan
|
|
73
|
+
- Automatic RTL detection and processing for tables containing RTL content
|
|
74
|
+
- Support for preserving table header structure in RTL layouts
|
|
75
|
+
- Comprehensive test examples for RTL table scenarios
|
|
76
|
+
|
|
77
|
+
### Improved
|
|
78
|
+
|
|
79
|
+
- Auto-RTL detection logic now respects explicit `supportRTL: false` setting
|
|
80
|
+
- Better handling of nested table headers with mixed span attributes
|
|
81
|
+
- Enhanced RTL text processing with proper bidirectional text support
|
|
82
|
+
- Improved column reversal algorithm that preserves span relationships
|
|
83
|
+
|
|
84
|
+
### Fixed
|
|
85
|
+
|
|
86
|
+
- Fixed RTL table header positioning issues with colSpan and rowSpan elements
|
|
87
|
+
- Resolved auto-RTL detection overriding explicit RTL settings
|
|
88
|
+
- Fixed column ordering in complex nested header structures
|
|
89
|
+
- Corrected span placeholder handling in RTL table reversal
|
|
90
|
+
|
|
91
|
+
### Technical Details
|
|
92
|
+
|
|
93
|
+
- Added `processAutoRTLTable` function for intelligent RTL detection
|
|
94
|
+
- Enhanced `rtlUtils.js` with span-aware reversal algorithms
|
|
95
|
+
- Improved error handling for empty object placeholders in span structures
|
|
96
|
+
- Added comprehensive unit tests for RTL table functionality
|
|
97
|
+
|
|
98
|
+
### Examples Added
|
|
99
|
+
|
|
100
|
+
- `examples/rtl-nested-header.js` - Demonstrates complex RTL table with nested headers
|
|
101
|
+
- `examples/test-simple-rtl-table.js` - Basic RTL table functionality test
|
|
102
|
+
- `examples/test-no-spans-rtl-table.js` - RTL table without span elements
|
|
103
|
+
|
|
104
|
+
### Breaking Changes
|
|
105
|
+
|
|
106
|
+
- None. All changes are backward compatible.
|
|
107
|
+
|
|
108
|
+
### Notes
|
|
109
|
+
|
|
110
|
+
- RTL detection threshold set to 30% RTL content for automatic table reversal
|
|
111
|
+
- Headers with span structures are preserved to maintain layout integrity
|
|
112
|
+
- Cell-level RTL text rendering (`bidi: true`) applied automatically for RTL content
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Previous Versions
|
|
117
|
+
|
|
118
|
+
This is the first tracked version of the changelog. For earlier changes, please refer to the git commit history.
|
package/README.md
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# pdfmake-RTL [![GitHub][github_img]][github_url] [![npm][npm_img]][npm_url]
|
|
1
|
+
# pdfmake-RTL [![Node.js CI][githubactions_img]][githubactions_url] [![GitHub][github_img]][github_url] [![npm][npm_img]][npm_url]
|
|
4
2
|
|
|
5
3
|
[githubactions_img]: https://github.com/aysnet1/pdfmake-rtl/actions/workflows/node.js.yml/badge.svg?branch=master
|
|
6
4
|
[githubactions_url]: https://github.com/aysnet1/pdfmake-rtl/actions
|
|
@@ -8,11 +6,10 @@
|
|
|
8
6
|
[github_url]: https://github.com/bpampuch/pdfmake-rtl/releases/latest
|
|
9
7
|
[npm_img]: https://img.shields.io/npm/v/pdfmake-rtl.svg?colorB=0E7FBF
|
|
10
8
|
[npm_url]: https://www.npmjs.com/package/pdfmake-rtl
|
|
11
|
-
[cdnjs_img]: https://img.shields.io/cdnjs/v/pdfmake-rtl.svg?colorB=0E7FBF
|
|
12
9
|
|
|
13
10
|
<!-- [cndjs_url]: https://cdnjs.com/libraries/pdfmake-rtl -->
|
|
14
11
|
|
|
15
|
-
**PDFMake RTL** is an enhanced version of PDFMake with **automatic RTL (Right-to-Left) language support** for Arabic, Persian (Farsi), Urdu, and other RTL scripts. No manual configuration needed
|
|
12
|
+
**PDFMake RTL** is an enhanced version of [PDFMake](https://www.npmjs.com/package/pdfmake) with **automatic RTL (Right-to-Left) language support** for Arabic, Persian (Farsi), Urdu, and other RTL scripts. No manual configuration needed—just write your content and the library automatically detects and handles RTL text!
|
|
16
13
|
|
|
17
14
|
All existing PDFMake code works unchanged, with automatic RTL support added!
|
|
18
15
|
|
|
@@ -41,6 +38,10 @@ PDF document generation library for server-side and client-side in pure JavaScri
|
|
|
41
38
|
|
|
42
39
|
Check out [the playground](http://aysnet1.github.io/pdfmake-rtl/playground.html) and [examples](https://github.com/aysnet1/pdfmake-rtl/tree/master/examples).
|
|
43
40
|
|
|
41
|
+
## documentation
|
|
42
|
+
|
|
43
|
+
For comprehensive guides, API references, and usage examples, visit the official documentation at [pdfmake.github.io/docs](https://pdfmake.github.io/docs/).
|
|
44
|
+
|
|
44
45
|
### Features
|
|
45
46
|
|
|
46
47
|
#### 🔤 RTL Language Support
|
|
@@ -99,8 +100,8 @@ npm install pdfmake-rtl
|
|
|
99
100
|
```html
|
|
100
101
|
<!-- Load pdfmake-rtl + fonts -->
|
|
101
102
|
<script src="https://unpkg.com/pdfmake-rtl/build/pdfmake.min.js"></script>
|
|
102
|
-
|
|
103
|
-
<script src="https://unpkg.com/pdfmake-rtl/build/fonts/Cairo.js"></script> -->
|
|
103
|
+
<script src="https://unpkg.com/pdfmake-rtl/build/vfs_fonts.js"></script>
|
|
104
|
+
<!-- <script src="https://unpkg.com/pdfmake-rtl/build/fonts/Cairo.js"></script> -->
|
|
104
105
|
|
|
105
106
|
<script>
|
|
106
107
|
var dd = {
|
|
@@ -159,15 +160,15 @@ npm install pdfmake-rtl
|
|
|
159
160
|
## ⚡ Quick Start — Node.js (Server-Side)
|
|
160
161
|
|
|
161
162
|
```js
|
|
162
|
-
var pdfmake = require("
|
|
163
|
+
var pdfmake = require("pdfmake-rtl");
|
|
163
164
|
|
|
164
165
|
// Add fonts
|
|
165
166
|
// Cairo is the default font for RTL languages (Arabic, Persian, Urdu)
|
|
166
167
|
// Roboto is the default font for LTR/Latin text
|
|
167
|
-
var Roboto = require("
|
|
168
|
+
var Roboto = require("pdfmake-rtl/fonts/Roboto");
|
|
168
169
|
pdfmake.addFonts(Roboto);
|
|
169
170
|
|
|
170
|
-
var Cairo = require("
|
|
171
|
+
var Cairo = require("pdfmake-rtl/fonts/Cairo");
|
|
171
172
|
pdfmake.addFonts(Cairo);
|
|
172
173
|
|
|
173
174
|
var dd = {
|
package/build/pdfmake.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @digicole/pdfmake-rtl v2.
|
|
1
|
+
/*! @digicole/pdfmake-rtl v2.1.2, @license MIT, @link https://github.com/aysnet1/pdfmake-rtl#readme */
|
|
2
2
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
3
3
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
4
4
|
module.exports = factory();
|
|
@@ -23,7 +23,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
// EXTERNAL MODULE: ./node_modules/pdfkit/js/pdfkit.es.js
|
|
26
|
-
var pdfkit_es = __webpack_require__(
|
|
26
|
+
var pdfkit_es = __webpack_require__(7697);
|
|
27
27
|
;// ./src/PDFDocument.js
|
|
28
28
|
/* provided dependency */ var Buffer = __webpack_require__(783)["Buffer"];
|
|
29
29
|
|
|
@@ -380,7 +380,7 @@ const ARABIC_RANGE = (/* unused pure expression or super */ null && ([[0x0600, 0
|
|
|
380
380
|
const PERSIAN_RANGE = (/* unused pure expression or super */ null && ([[0x06A9, 0x06AF],
|
|
381
381
|
// Persian Kaf, Gaf
|
|
382
382
|
[0x06C0, 0x06C3],
|
|
383
|
-
// Persian Heh,
|
|
383
|
+
// Persian Heh, Marbuta variants
|
|
384
384
|
[0x06CC, 0x06CE],
|
|
385
385
|
// Persian Yeh variants
|
|
386
386
|
[0x06D0, 0x06D5],
|
|
@@ -725,6 +725,9 @@ function processRTLTable(tableNode, forceRTL) {
|
|
|
725
725
|
shouldBeRTL = totalCells > 0 && rtlCellCount / totalCells >= 0.3;
|
|
726
726
|
}
|
|
727
727
|
if (shouldBeRTL) {
|
|
728
|
+
// Mark the table as RTL for the drawing phase (TableProcessor uses this)
|
|
729
|
+
tableNode.table._rtl = true;
|
|
730
|
+
|
|
728
731
|
// Reverse table columns for RTL layout, handling colSpan correctly
|
|
729
732
|
tableNode.table.body = tableNode.table.body.map(row => {
|
|
730
733
|
if (Array.isArray(row)) {
|
|
@@ -5281,7 +5284,7 @@ class ElementWriter extends events.EventEmitter {
|
|
|
5281
5284
|
const LTR_REGEX = /[A-Za-z\u00C0-\u024F\u1E00-\u1EFF]/;
|
|
5282
5285
|
const NUMBER_PUNCTUATION_REGEX = /^(\d+)([.:/\-)(]+)(\s*)$/;
|
|
5283
5286
|
// Characters that are "boundary neutral" — separators/punctuation between scripts
|
|
5284
|
-
const BOUNDARY_NEUTRAL = /[
|
|
5287
|
+
const BOUNDARY_NEUTRAL = /[/\\\-()[\]{}<>:;.,!?@#$%^&*_=+|~`'"،؛؟\s]/;
|
|
5285
5288
|
|
|
5286
5289
|
// --- Step 0: Pre-split inlines at RTL↔neutral and LTR↔neutral boundaries ---
|
|
5287
5290
|
// e.g. "العربية/" → ["العربية", "/"] and "hello-" → ["hello", "-"]
|
|
@@ -5393,8 +5396,8 @@ class ElementWriter extends events.EventEmitter {
|
|
|
5393
5396
|
// Find matching bracket pairs across runs. If the content between
|
|
5394
5397
|
// a "(" neutral run and a ")" neutral run is predominantly one direction,
|
|
5395
5398
|
// merge the opening bracket, content, and closing bracket into that direction.
|
|
5396
|
-
const OPEN_BRACKETS = /[(
|
|
5397
|
-
const CLOSE_BRACKETS = /[)\]}>]/;
|
|
5399
|
+
const OPEN_BRACKETS = /[(\\[{<]/;
|
|
5400
|
+
// const CLOSE_BRACKETS = /[)\]}>]/;
|
|
5398
5401
|
const BRACKET_MATCH = {
|
|
5399
5402
|
'(': ')',
|
|
5400
5403
|
'[': ']',
|
|
@@ -6227,6 +6230,19 @@ class TableProcessor {
|
|
|
6227
6230
|
columnCalculator.buildColumnWidths(tableNode.table.widths, availableWidth, this.offsets.total, tableNode);
|
|
6228
6231
|
this.tableWidth = tableNode._offsets.total + getTableInnerContentWidth();
|
|
6229
6232
|
this.rowSpanData = prepareRowSpanData();
|
|
6233
|
+
|
|
6234
|
+
// RTL table right-alignment: shift the table grid to the right
|
|
6235
|
+
// when the table doesn't fill the full available width
|
|
6236
|
+
if (tableNode.table._rtl) {
|
|
6237
|
+
let fullAvailableWidth = writer.context().availableWidth;
|
|
6238
|
+
let rtlOffset = fullAvailableWidth - this.tableWidth;
|
|
6239
|
+
if (rtlOffset > 0.5) {
|
|
6240
|
+
// only shift if there's meaningful space
|
|
6241
|
+
for (let i = 0; i < this.rowSpanData.length; i++) {
|
|
6242
|
+
this.rowSpanData[i].left += rtlOffset;
|
|
6243
|
+
}
|
|
6244
|
+
}
|
|
6245
|
+
}
|
|
6230
6246
|
this.cleanUpRepeatables = false;
|
|
6231
6247
|
|
|
6232
6248
|
// headersRows and rowsWithoutPageBreak (headerRows + keepWithHeaderRows)
|
|
@@ -7570,6 +7586,19 @@ class LayoutBuilder {
|
|
|
7570
7586
|
const marginXParent = this.nestedLevel === 1 ? marginX : null;
|
|
7571
7587
|
const _bottomByPage = tableNode ? tableNode._bottomByPage : null;
|
|
7572
7588
|
this.writer.context().beginColumnGroup(marginXParent, _bottomByPage);
|
|
7589
|
+
|
|
7590
|
+
// RTL table right-alignment: shift the starting x position to the right
|
|
7591
|
+
// so that the table content aligns with the right-aligned grid
|
|
7592
|
+
if (tableNode && tableNode.table && tableNode.table._rtl) {
|
|
7593
|
+
let tableWidth = tableNode._offsets.total;
|
|
7594
|
+
for (let w = 0; w < widths.length; w++) {
|
|
7595
|
+
tableWidth += widths[w]._calcWidth;
|
|
7596
|
+
}
|
|
7597
|
+
let rtlOffset = this.writer.context().availableWidth - tableWidth;
|
|
7598
|
+
if (rtlOffset > 0.5) {
|
|
7599
|
+
this.writer.context().x += rtlOffset;
|
|
7600
|
+
}
|
|
7601
|
+
}
|
|
7573
7602
|
for (let i = 0, l = cells.length; i < l; i++) {
|
|
7574
7603
|
let cell = cells[i];
|
|
7575
7604
|
let cellIndexBegin = i;
|
|
@@ -8702,26 +8731,26 @@ class Renderer {
|
|
|
8702
8731
|
|
|
8703
8732
|
|
|
8704
8733
|
|
|
8705
|
-
/**
|
|
8706
|
-
* Printer which turns document definition into a pdf
|
|
8707
|
-
*
|
|
8708
|
-
* @example
|
|
8709
|
-
* var fontDescriptors = {
|
|
8710
|
-
* Roboto: {
|
|
8711
|
-
* normal: 'fonts/Roboto-Regular.ttf',
|
|
8712
|
-
* bold: 'fonts/Roboto-Medium.ttf',
|
|
8713
|
-
* italics: 'fonts/Roboto-Italic.ttf',
|
|
8714
|
-
* bolditalics: 'fonts/Roboto-MediumItalic.ttf'
|
|
8715
|
-
* }
|
|
8716
|
-
* };
|
|
8717
|
-
*
|
|
8718
|
-
* var printer = new PdfPrinter(fontDescriptors);
|
|
8734
|
+
/**
|
|
8735
|
+
* Printer which turns document definition into a pdf
|
|
8736
|
+
*
|
|
8737
|
+
* @example
|
|
8738
|
+
* var fontDescriptors = {
|
|
8739
|
+
* Roboto: {
|
|
8740
|
+
* normal: 'fonts/Roboto-Regular.ttf',
|
|
8741
|
+
* bold: 'fonts/Roboto-Medium.ttf',
|
|
8742
|
+
* italics: 'fonts/Roboto-Italic.ttf',
|
|
8743
|
+
* bolditalics: 'fonts/Roboto-MediumItalic.ttf'
|
|
8744
|
+
* }
|
|
8745
|
+
* };
|
|
8746
|
+
*
|
|
8747
|
+
* var printer = new PdfPrinter(fontDescriptors);
|
|
8719
8748
|
*/
|
|
8720
8749
|
class PdfPrinter {
|
|
8721
|
-
/**
|
|
8722
|
-
* @param {object} fontDescriptors font definition dictionary
|
|
8723
|
-
* @param {object} virtualfs
|
|
8724
|
-
* @param {object} urlResolver
|
|
8750
|
+
/**
|
|
8751
|
+
* @param {object} fontDescriptors font definition dictionary
|
|
8752
|
+
* @param {object} virtualfs
|
|
8753
|
+
* @param {object} urlResolver
|
|
8725
8754
|
*/
|
|
8726
8755
|
constructor(fontDescriptors, virtualfs, urlResolver) {
|
|
8727
8756
|
if (virtualfs === void 0) {
|
|
@@ -8735,13 +8764,13 @@ class PdfPrinter {
|
|
|
8735
8764
|
this.urlResolver = urlResolver;
|
|
8736
8765
|
}
|
|
8737
8766
|
|
|
8738
|
-
/**
|
|
8739
|
-
* Executes layout engine for the specified document and renders it into a pdfkit document
|
|
8740
|
-
* ready to be saved.
|
|
8741
|
-
*
|
|
8742
|
-
* @param {object} docDefinition
|
|
8743
|
-
* @param {object} options
|
|
8744
|
-
* @returns {Promise<PDFDocument>} resolved promise return a pdfkit document
|
|
8767
|
+
/**
|
|
8768
|
+
* Executes layout engine for the specified document and renders it into a pdfkit document
|
|
8769
|
+
* ready to be saved.
|
|
8770
|
+
*
|
|
8771
|
+
* @param {object} docDefinition
|
|
8772
|
+
* @param {object} options
|
|
8773
|
+
* @returns {Promise<PDFDocument>} resolved promise return a pdfkit document
|
|
8745
8774
|
*/
|
|
8746
8775
|
async createPdfKitDocument(docDefinition, options) {
|
|
8747
8776
|
if (options === void 0) {
|
|
@@ -8815,9 +8844,9 @@ class PdfPrinter {
|
|
|
8815
8844
|
return this.pdfKitDoc;
|
|
8816
8845
|
}
|
|
8817
8846
|
|
|
8818
|
-
/**
|
|
8819
|
-
* @param {object} docDefinition
|
|
8820
|
-
* @returns {Promise}
|
|
8847
|
+
/**
|
|
8848
|
+
* @param {object} docDefinition
|
|
8849
|
+
* @returns {Promise}
|
|
8821
8850
|
*/
|
|
8822
8851
|
async resolveUrls(docDefinition) {
|
|
8823
8852
|
const getExtendedUrl = url => {
|
|
@@ -8917,11 +8946,11 @@ class PdfPrinter {
|
|
|
8917
8946
|
await this.urlResolver.resolved();
|
|
8918
8947
|
}
|
|
8919
8948
|
|
|
8920
|
-
/**
|
|
8921
|
-
* Check if content contains RTL characters
|
|
8922
|
-
* @param {any} content - Document content
|
|
8923
|
-
* @returns {boolean} - True if content contains RTL characters
|
|
8924
|
-
* @private
|
|
8949
|
+
/**
|
|
8950
|
+
* Check if content contains RTL characters
|
|
8951
|
+
* @param {any} content - Document content
|
|
8952
|
+
* @returns {boolean} - True if content contains RTL characters
|
|
8953
|
+
* @private
|
|
8925
8954
|
*/
|
|
8926
8955
|
_containsRTLContent(content) {
|
|
8927
8956
|
if (!content) {
|
|
@@ -9171,7 +9200,7 @@ class OutputDocument {
|
|
|
9171
9200
|
}
|
|
9172
9201
|
/* harmony default export */ const src_OutputDocument = (OutputDocument);
|
|
9173
9202
|
// EXTERNAL MODULE: ./node_modules/file-saver/dist/FileSaver.min.js
|
|
9174
|
-
var FileSaver_min = __webpack_require__(
|
|
9203
|
+
var FileSaver_min = __webpack_require__(553);
|
|
9175
9204
|
;// ./src/browser-extensions/OutputDocumentBrowser.js
|
|
9176
9205
|
|
|
9177
9206
|
|
|
@@ -22615,7 +22644,7 @@ module.exports = {
|
|
|
22615
22644
|
|
|
22616
22645
|
/***/ },
|
|
22617
22646
|
|
|
22618
|
-
/***/
|
|
22647
|
+
/***/ 7697
|
|
22619
22648
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
22620
22649
|
|
|
22621
22650
|
"use strict";
|
|
@@ -49726,7 +49755,7 @@ module.exports = function whichTypedArray(value) {
|
|
|
49726
49755
|
|
|
49727
49756
|
/***/ },
|
|
49728
49757
|
|
|
49729
|
-
/***/
|
|
49758
|
+
/***/ 553
|
|
49730
49759
|
(module, exports, __webpack_require__) {
|
|
49731
49760
|
|
|
49732
49761
|
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function(a,b){if(true)!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (b),
|