bare-x-to-pdf 0.2.0 → 0.4.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/CMakeLists.txt +9 -2
- package/LICENSE.md +198 -0
- package/NOTICE.md +13 -0
- package/README.md +86 -29
- package/binding.c +240 -48
- package/cmake/rust.cmake +2 -2
- package/core/Cargo.lock +19 -234
- package/core/Cargo.toml +2 -2
- package/core/include/simple_converter.h +0 -1
- package/core/src/doc/mod.rs +31 -16
- package/core/src/docx/mod.rs +15 -6
- package/core/src/docx/numbering.rs +8 -4
- package/core/src/lib.rs +42 -16
- package/core/src/limits.rs +42 -0
- package/core/src/markdown/mod.rs +461 -0
- package/core/src/markdown/style.rs +191 -0
- package/core/src/model.rs +26 -40
- package/core/src/odf_chart.rs +240 -0
- package/core/src/odt/geometry.rs +504 -0
- package/core/src/odt/mod.rs +62 -20
- package/core/src/odt/odp.rs +438 -0
- package/core/src/odt/styles.rs +151 -30
- package/core/src/pptx/mod.rs +25 -10
- package/core/src/pptx/text.rs +2 -2
- package/core/src/typst_backend/emit.rs +132 -33
- package/core/src/typst_backend/fonts.rs +1 -1
- package/core/src/typst_backend/images.rs +76 -0
- package/core/src/typst_backend/mod.rs +57 -7
- package/core/src/typst_backend/notes.rs +156 -0
- package/core/src/xlsx/biff.rs +1010 -0
- package/core/src/xlsx/biff_art.rs +201 -0
- package/core/src/xlsx/biff_cf.rs +339 -0
- package/core/src/xlsx/biff_chart.rs +317 -0
- package/core/src/xlsx/formula.rs +30 -3
- package/core/src/xlsx/mod.rs +318 -124
- package/core/src/xlsx/ods.rs +780 -0
- package/core/src/xml.rs +6 -1
- package/index.d.ts +27 -5
- package/index.js +153 -38
- package/package.json +36 -32
- package/cmake/pdfium.cmake +0 -75
- package/core/src/docx/writer.rs +0 -222
- package/core/src/pdf/mod.rs +0 -354
package/CMakeLists.txt
CHANGED
|
@@ -6,11 +6,10 @@ find_package(cmake-fetch REQUIRED PATHS node_modules/cmake-fetch)
|
|
|
6
6
|
project(simple_converter C)
|
|
7
7
|
|
|
8
8
|
include(cmake/rust.cmake)
|
|
9
|
-
include(cmake/pdfium.cmake)
|
|
10
9
|
|
|
11
10
|
bare_target(target)
|
|
12
11
|
|
|
13
|
-
add_bare_module(simple_converter NAME bare-x-to-pdf-${target}
|
|
12
|
+
add_bare_module(simple_converter NAME bare-x-to-pdf-${target})
|
|
14
13
|
|
|
15
14
|
target_sources(
|
|
16
15
|
${simple_converter}
|
|
@@ -29,3 +28,11 @@ target_link_libraries(
|
|
|
29
28
|
PRIVATE
|
|
30
29
|
simple_converter_core
|
|
31
30
|
)
|
|
31
|
+
|
|
32
|
+
if(CMAKE_STRIP AND NOT WIN32)
|
|
33
|
+
add_custom_command(
|
|
34
|
+
TARGET ${simple_converter}_module
|
|
35
|
+
POST_BUILD
|
|
36
|
+
COMMAND ${CMAKE_STRIP} $<IF:$<PLATFORM_ID:Darwin,iOS>,-x,--strip-unneeded> $<TARGET_FILE:${simple_converter}_module>
|
|
37
|
+
)
|
|
38
|
+
endif()
|
package/LICENSE.md
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
# License
|
|
2
|
+
|
|
3
|
+
This project is licensed under the Apache License, Version 2.0.
|
|
4
|
+
See below for the full license text.
|
|
5
|
+
|
|
6
|
+
## Apache License
|
|
7
|
+
|
|
8
|
+
_Version 2.0, January 2004_
|
|
9
|
+
_<<http://www.apache.org/licenses/>>_
|
|
10
|
+
|
|
11
|
+
### Terms and Conditions for use, reproduction, and distribution
|
|
12
|
+
|
|
13
|
+
#### 1. Definitions
|
|
14
|
+
|
|
15
|
+
“License” shall mean the terms and conditions for use, reproduction, and
|
|
16
|
+
distribution as defined by Sections 1 through 9 of this document.
|
|
17
|
+
|
|
18
|
+
“Licensor” shall mean the copyright owner or entity authorized by the copyright
|
|
19
|
+
owner that is granting the License.
|
|
20
|
+
|
|
21
|
+
“Legal Entity” shall mean the union of the acting entity and all other entities
|
|
22
|
+
that control, are controlled by, or are under common control with that entity.
|
|
23
|
+
For the purposes of this definition, “control” means **(i)** the power, direct or
|
|
24
|
+
indirect, to cause the direction or management of such entity, whether by
|
|
25
|
+
contract or otherwise, or **(ii)** ownership of fifty percent (50%) or more of the
|
|
26
|
+
outstanding shares, or **(iii)** beneficial ownership of such entity.
|
|
27
|
+
|
|
28
|
+
“You” (or “Your”) shall mean an individual or Legal Entity exercising
|
|
29
|
+
permissions granted by this License.
|
|
30
|
+
|
|
31
|
+
“Source” form shall mean the preferred form for making modifications, including
|
|
32
|
+
but not limited to software source code, documentation source, and configuration
|
|
33
|
+
files.
|
|
34
|
+
|
|
35
|
+
“Object” form shall mean any form resulting from mechanical transformation or
|
|
36
|
+
translation of a Source form, including but not limited to compiled object code,
|
|
37
|
+
generated documentation, and conversions to other media types.
|
|
38
|
+
|
|
39
|
+
“Work” shall mean the work of authorship, whether in Source or Object form, made
|
|
40
|
+
available under the License, as indicated by a copyright notice that is included
|
|
41
|
+
in or attached to the work (an example is provided in the Appendix below).
|
|
42
|
+
|
|
43
|
+
“Derivative Works” shall mean any work, whether in Source or Object form, that
|
|
44
|
+
is based on (or derived from) the Work and for which the editorial revisions,
|
|
45
|
+
annotations, elaborations, or other modifications represent, as a whole, an
|
|
46
|
+
original work of authorship. For the purposes of this License, Derivative Works
|
|
47
|
+
shall not include works that remain separable from, or merely link (or bind by
|
|
48
|
+
name) to the interfaces of, the Work and Derivative Works thereof.
|
|
49
|
+
|
|
50
|
+
“Contribution” shall mean any work of authorship, including the original version
|
|
51
|
+
of the Work and any modifications or additions to that Work or Derivative Works
|
|
52
|
+
thereof, that is intentionally submitted to Licensor for inclusion in the Work
|
|
53
|
+
by the copyright owner or by an individual or Legal Entity authorized to submit
|
|
54
|
+
on behalf of the copyright owner. For the purposes of this definition,
|
|
55
|
+
“submitted” means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems, and
|
|
58
|
+
issue tracking systems that are managed by, or on behalf of, the Licensor for
|
|
59
|
+
the purpose of discussing and improving the Work, but excluding communication
|
|
60
|
+
that is conspicuously marked or otherwise designated in writing by the copyright
|
|
61
|
+
owner as “Not a Contribution.”
|
|
62
|
+
|
|
63
|
+
“Contributor” shall mean Licensor and any individual or Legal Entity on behalf
|
|
64
|
+
of whom a Contribution has been received by Licensor and subsequently
|
|
65
|
+
incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
#### 2. Grant of Copyright License
|
|
68
|
+
|
|
69
|
+
Subject to the terms and conditions of this License, each Contributor hereby
|
|
70
|
+
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
|
|
71
|
+
irrevocable copyright license to reproduce, prepare Derivative Works of,
|
|
72
|
+
publicly display, publicly perform, sublicense, and distribute the Work and such
|
|
73
|
+
Derivative Works in Source or Object form.
|
|
74
|
+
|
|
75
|
+
#### 3. Grant of Patent License
|
|
76
|
+
|
|
77
|
+
Subject to the terms and conditions of this License, each Contributor hereby
|
|
78
|
+
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
|
|
79
|
+
irrevocable (except as stated in this section) patent license to make, have
|
|
80
|
+
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
|
|
81
|
+
such license applies only to those patent claims licensable by such Contributor
|
|
82
|
+
that are necessarily infringed by their Contribution(s) alone or by combination
|
|
83
|
+
of their Contribution(s) with the Work to which such Contribution(s) was
|
|
84
|
+
submitted. If You institute patent litigation against any entity (including a
|
|
85
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
|
|
86
|
+
Contribution incorporated within the Work constitutes direct or contributory
|
|
87
|
+
patent infringement, then any patent licenses granted to You under this License
|
|
88
|
+
for that Work shall terminate as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
#### 4. Redistribution
|
|
91
|
+
|
|
92
|
+
You may reproduce and distribute copies of the Work or Derivative Works thereof
|
|
93
|
+
in any medium, with or without modifications, and in Source or Object form,
|
|
94
|
+
provided that You meet the following conditions:
|
|
95
|
+
|
|
96
|
+
- **(a)** You must give any other recipients of the Work or Derivative Works a copy of
|
|
97
|
+
this License; and
|
|
98
|
+
- **(b)** You must cause any modified files to carry prominent notices stating that You
|
|
99
|
+
changed the files; and
|
|
100
|
+
- **(c)** You must retain, in the Source form of any Derivative Works that You distribute,
|
|
101
|
+
all copyright, patent, trademark, and attribution notices from the Source form
|
|
102
|
+
of the Work, excluding those notices that do not pertain to any part of the
|
|
103
|
+
Derivative Works; and
|
|
104
|
+
- **(d)** If the Work includes a “NOTICE” text file as part of its distribution, then any
|
|
105
|
+
Derivative Works that You distribute must include a readable copy of the
|
|
106
|
+
attribution notices contained within such NOTICE file, excluding those notices
|
|
107
|
+
that do not pertain to any part of the Derivative Works, in at least one of the
|
|
108
|
+
following places: within a NOTICE text file distributed as part of the
|
|
109
|
+
Derivative Works; within the Source form or documentation, if provided along
|
|
110
|
+
with the Derivative Works; or, within a display generated by the Derivative
|
|
111
|
+
Works, if and wherever such third-party notices normally appear. The contents of
|
|
112
|
+
the NOTICE file are for informational purposes only and do not modify the
|
|
113
|
+
License. You may add Your own attribution notices within Derivative Works that
|
|
114
|
+
You distribute, alongside or as an addendum to the NOTICE text from the Work,
|
|
115
|
+
provided that such additional attribution notices cannot be construed as
|
|
116
|
+
modifying the License.
|
|
117
|
+
|
|
118
|
+
You may add Your own copyright statement to Your modifications and may provide
|
|
119
|
+
additional or different license terms and conditions for use, reproduction, or
|
|
120
|
+
distribution of Your modifications, or for any such Derivative Works as a whole,
|
|
121
|
+
provided Your use, reproduction, and distribution of the Work otherwise complies
|
|
122
|
+
with the conditions stated in this License.
|
|
123
|
+
|
|
124
|
+
#### 5. Submission of Contributions
|
|
125
|
+
|
|
126
|
+
Unless You explicitly state otherwise, any Contribution intentionally submitted
|
|
127
|
+
for inclusion in the Work by You to the Licensor shall be under the terms and
|
|
128
|
+
conditions of this License, without any additional terms or conditions.
|
|
129
|
+
Notwithstanding the above, nothing herein shall supersede or modify the terms of
|
|
130
|
+
any separate license agreement you may have executed with Licensor regarding
|
|
131
|
+
such Contributions.
|
|
132
|
+
|
|
133
|
+
#### 6. Trademarks
|
|
134
|
+
|
|
135
|
+
This License does not grant permission to use the trade names, trademarks,
|
|
136
|
+
service marks, or product names of the Licensor, except as required for
|
|
137
|
+
reasonable and customary use in describing the origin of the Work and
|
|
138
|
+
reproducing the content of the NOTICE file.
|
|
139
|
+
|
|
140
|
+
#### 7. Disclaimer of Warranty
|
|
141
|
+
|
|
142
|
+
Unless required by applicable law or agreed to in writing, Licensor provides the
|
|
143
|
+
Work (and each Contributor provides its Contributions) on an “AS IS” BASIS,
|
|
144
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
|
|
145
|
+
including, without limitation, any warranties or conditions of TITLE,
|
|
146
|
+
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
|
|
147
|
+
solely responsible for determining the appropriateness of using or
|
|
148
|
+
redistributing the Work and assume any risks associated with Your exercise of
|
|
149
|
+
permissions under this License.
|
|
150
|
+
|
|
151
|
+
#### 8. Limitation of Liability
|
|
152
|
+
|
|
153
|
+
In no event and under no legal theory, whether in tort (including negligence),
|
|
154
|
+
contract, or otherwise, unless required by applicable law (such as deliberate
|
|
155
|
+
and grossly negligent acts) or agreed to in writing, shall any Contributor be
|
|
156
|
+
liable to You for damages, including any direct, indirect, special, incidental,
|
|
157
|
+
or consequential damages of any character arising as a result of this License or
|
|
158
|
+
out of the use or inability to use the Work (including but not limited to
|
|
159
|
+
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
|
|
160
|
+
any and all other commercial damages or losses), even if such Contributor has
|
|
161
|
+
been advised of the possibility of such damages.
|
|
162
|
+
|
|
163
|
+
#### 9. Accepting Warranty or Additional Liability
|
|
164
|
+
|
|
165
|
+
While redistributing the Work or Derivative Works thereof, You may choose to
|
|
166
|
+
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
|
|
167
|
+
other liability obligations and/or rights consistent with this License. However,
|
|
168
|
+
in accepting such obligations, You may act only on Your own behalf and on Your
|
|
169
|
+
sole responsibility, not on behalf of any other Contributor, and only if You
|
|
170
|
+
agree to indemnify, defend, and hold each Contributor harmless for any liability
|
|
171
|
+
incurred by, or claims asserted against, such Contributor by reason of your
|
|
172
|
+
accepting any such warranty or additional liability.
|
|
173
|
+
|
|
174
|
+
_END OF TERMS AND CONDITIONS_
|
|
175
|
+
|
|
176
|
+
### APPENDIX: How to apply the Apache License to your work
|
|
177
|
+
|
|
178
|
+
To apply the Apache License to your work, attach the following boilerplate
|
|
179
|
+
notice, with the fields enclosed by brackets `[]` replaced with your own
|
|
180
|
+
identifying information. (Don't include the brackets!) The text should be
|
|
181
|
+
enclosed in the appropriate comment syntax for the file format. We also
|
|
182
|
+
recommend that a file or class name and description of purpose be included on
|
|
183
|
+
the same “printed page” as the copyright notice for easier identification within
|
|
184
|
+
third-party archives.
|
|
185
|
+
|
|
186
|
+
Copyright [yyyy] [name of copyright owner]
|
|
187
|
+
|
|
188
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
189
|
+
you may not use this file except in compliance with the License.
|
|
190
|
+
You may obtain a copy of the License at
|
|
191
|
+
|
|
192
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
193
|
+
|
|
194
|
+
Unless required by applicable law or agreed to in writing, software
|
|
195
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
196
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
197
|
+
See the License for the specific language governing permissions and
|
|
198
|
+
limitations under the License.
|
package/NOTICE.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Copyright 2026 Tether Inc
|
|
2
|
+
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
See the License for the specific language governing permissions and
|
|
13
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -2,31 +2,38 @@
|
|
|
2
2
|
|
|
3
3
|
Convert office documents to PDF for [Bare](https://github.com/holepunchto/bare).
|
|
4
4
|
A native addon with a Rust engine that lays pages out with
|
|
5
|
-
[Typst](https://typst.app)
|
|
6
|
-
[PDFium](https://pdfium.googlesource.com/pdfium/).
|
|
5
|
+
[Typst](https://typst.app).
|
|
7
6
|
|
|
8
7
|
`x` is every format it reads into a PDF today:
|
|
9
8
|
|
|
10
|
-
| Family
|
|
11
|
-
|
|
|
12
|
-
| Word
|
|
13
|
-
| Word 97–2003
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
| Family | Extensions |
|
|
10
|
+
| ------------------------- | ---------------------------------- |
|
|
11
|
+
| Word | `.docx`, `.docm`, `.dotx`, `.dotm` |
|
|
12
|
+
| Word 97–2003 | `.doc`, `.dot` |
|
|
13
|
+
| Excel | `.xlsx`, `.xlsm`, `.xltx`, `.xltm` |
|
|
14
|
+
| Excel 97–2003 | `.xls`, `.xlt` |
|
|
15
|
+
| PowerPoint | `.pptx` |
|
|
16
|
+
| OpenDocument Text | `.odt`, `.ott`, `.fodt` |
|
|
17
|
+
| OpenDocument Spreadsheet | `.ods`, `.ots`, `.fods` |
|
|
18
|
+
| OpenDocument Presentation | `.odp`, `.otp`, `.fodp` |
|
|
19
|
+
| Markdown | `.md`, `.markdown` |
|
|
20
|
+
|
|
21
|
+
The `from` name for each is the extension without its dot, and PDF is the only output.
|
|
22
|
+
Markdown is CommonMark plus GitHub tables, task lists and strikethrough. Legacy
|
|
23
|
+
PowerPoint (`.ppt`), `.pptm`, `.potx`, `.ppsx`, Rich Text and HTML are not read.
|
|
19
24
|
|
|
20
25
|
## Install
|
|
21
26
|
|
|
22
27
|
```sh
|
|
23
|
-
npm install bare-x-to-pdf
|
|
28
|
+
npm install bare-x-to-pdf
|
|
24
29
|
```
|
|
25
30
|
|
|
26
31
|
The native prebuild is an optional dependency per platform (`bare-x-to-pdf-<platform>-<arch>`),
|
|
27
|
-
so an install downloads only the package for its own platform, about
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
so an install downloads only the package for its own platform, about 17 MB packed and
|
|
33
|
+
42 MB unpacked, plus the main package with the fonts and sources, about 4 MB packed.
|
|
34
|
+
Prebuilds exist for android (arm, arm64, x64), darwin (arm64, x64), ios (arm64 and the
|
|
35
|
+
arm64 and x64 simulators), linux (arm64, x64) and win32 (x64); other hosts build from a
|
|
36
|
+
checkout with the Bare toolchain, CMake 4 and Rust.
|
|
30
37
|
|
|
31
38
|
To bundle for a different platform, ask npm for that prebuild as well:
|
|
32
39
|
|
|
@@ -40,27 +47,38 @@ npm install --os=ios --cpu=arm64
|
|
|
40
47
|
```js
|
|
41
48
|
const converter = require('bare-x-to-pdf')
|
|
42
49
|
|
|
43
|
-
const pdf = converter.convert(docxBytes, { to: 'pdf' })
|
|
44
|
-
const docx = converter.convert(pdfBytes, { to: 'docx' })
|
|
50
|
+
const pdf = await converter.convert(docxBytes, { to: 'pdf' })
|
|
45
51
|
```
|
|
46
52
|
|
|
47
|
-
Input is a `Uint8Array` or `ArrayBuffer` and the result is a `Buffer`.
|
|
48
|
-
|
|
53
|
+
Input is a `Uint8Array` or `ArrayBuffer` and the result is a `Buffer`. `convert()` runs on
|
|
54
|
+
the libuv thread pool and does not block the JavaScript thread; `convertSync()` runs on the
|
|
55
|
+
calling thread.
|
|
49
56
|
|
|
50
57
|
## API
|
|
51
58
|
|
|
52
|
-
### `convert(input, options)`
|
|
59
|
+
### `const pdf = await convert(input, options)`
|
|
53
60
|
|
|
54
|
-
Convert `input` and
|
|
61
|
+
Convert `input` off the JavaScript thread and resolve with a `Buffer`. The input is copied,
|
|
62
|
+
so it may be changed or transferred once the call returns. Invalid options and conversion
|
|
63
|
+
errors reject the promise.
|
|
55
64
|
|
|
56
|
-
- `options.to` — target format,
|
|
57
|
-
- `options.from` — source format; sniffed from the bytes when omitted.
|
|
65
|
+
- `options.to` — target format, `'pdf'`. Required.
|
|
66
|
+
- `options.from` — source format; sniffed from the bytes when omitted. Markdown has no
|
|
67
|
+
signature to sniff, so pass `from: 'md'` for it. Markdown images load only from `data:`
|
|
68
|
+
URIs, since the input is bytes with no directory to resolve relative paths against.
|
|
58
69
|
- `options.fontsDir` — a directory of fonts to use instead of the bundled set.
|
|
59
|
-
|
|
70
|
+
|
|
71
|
+
### `const pdf = convertSync(input, options)`
|
|
72
|
+
|
|
73
|
+
Convert `input` on the calling thread and return a `Buffer`. Takes the same options as
|
|
74
|
+
`convert()`.
|
|
60
75
|
|
|
61
76
|
### `detect(input)`
|
|
62
77
|
|
|
63
|
-
|
|
78
|
+
Sniff the format from the bytes and return `'docx'`, `'pptx'`, `'xlsx'`, `'doc'`, `'xls'`,
|
|
79
|
+
`'odt'`, `'ods'`, `'odp'`, `'fodt'`, `'fods'`, `'fodp'` or `null`. Templates and
|
|
80
|
+
macro-enabled files report their base format (a `.dotx` is `'docx'`, an `.ots` is
|
|
81
|
+
`'ods'`), which converts the same way. Markdown is plain text and always returns `null`.
|
|
64
82
|
|
|
65
83
|
### `supports(from, to)`
|
|
66
84
|
|
|
@@ -74,11 +92,50 @@ Return every supported pair as `{ from, to }`.
|
|
|
74
92
|
|
|
75
93
|
Path to the bundled fonts directory.
|
|
76
94
|
|
|
77
|
-
|
|
95
|
+
## Limits
|
|
96
|
+
|
|
97
|
+
Documents are often untrusted, so the engine caps what a small file can make it allocate or
|
|
98
|
+
lay out. A document past a hard limit is rejected with an error. One past a soft limit still
|
|
99
|
+
converts, with the value clamped.
|
|
100
|
+
|
|
101
|
+
Rejected:
|
|
102
|
+
|
|
103
|
+
- An archive part larger than 128 MB uncompressed.
|
|
104
|
+
- XML nested more than 512 elements deep.
|
|
105
|
+
- A spreadsheet that would print more than 30,000 cells.
|
|
106
|
+
|
|
107
|
+
Clamped:
|
|
108
|
+
|
|
109
|
+
- Table spans: 1–1,000 columns.
|
|
110
|
+
- Text columns: 1–64.
|
|
111
|
+
- Pages: 72–14,400 pt on each side, with margins scaled to fit.
|
|
112
|
+
- Lengths: NaN and infinity become 0; any other length is held within ±1,000,000 pt.
|
|
113
|
+
- List counters: above 32,767, letter and Roman labels fall back to decimal.
|
|
114
|
+
- Charts: up to 100,000 points per series (in .xls, 32,000 per series and 256,000 per chart).
|
|
115
|
+
- Formulas: nesting depth up to 256.
|
|
116
|
+
- Images: more than 50 megapixels, or ones that cannot be decoded, are drawn as blank
|
|
117
|
+
space.
|
|
118
|
+
- Tables nested more than 12 deep: the inner tables are flattened into paragraphs.
|
|
119
|
+
|
|
120
|
+
Spreadsheet pages with no content are not printed, as in LibreOffice Calc.
|
|
121
|
+
|
|
122
|
+
## Development
|
|
123
|
+
|
|
124
|
+
The platform packages in `npm/` are npm workspaces, and each declares its own `os` and `cpu`
|
|
125
|
+
so that installs download only one. In a checkout, install with `npm install --force` so npm
|
|
126
|
+
links all of them, then build the host prebuild with `npm run prebuild` and run `npm test`.
|
|
127
|
+
The fidelity benchmark in `bench/` has its own dependencies: `cd bench && npm install`.
|
|
128
|
+
|
|
129
|
+
## Releases
|
|
78
130
|
|
|
79
|
-
|
|
131
|
+
`.github/workflows/publish.yml` runs when a `v*` tag is pushed. Tag the commit whose
|
|
132
|
+
`package.json` has that version, after running `npm run packages` to bring the platform
|
|
133
|
+
packages to it. The workflow builds every platform, publishes the platform packages and then
|
|
134
|
+
the main package through npm trusted publishing, and creates a GitHub release. A tag newer
|
|
135
|
+
than npm's current `latest` publishes as `latest`; an older one as `release-<major>.<minor>`.
|
|
80
136
|
|
|
81
137
|
## License
|
|
82
138
|
|
|
83
|
-
Apache-2.0.
|
|
84
|
-
|
|
139
|
+
Apache-2.0. Typst, pulldown-cmark and the other Rust dependencies are Apache-2.0 or MIT.
|
|
140
|
+
Liberation, Carlito and Caladea are under the SIL Open Font License (see `fonts/`);
|
|
141
|
+
OpenSymbol comes from LibreOffice.
|