@imggion/html2realpdf 0.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/README.md +292 -0
- package/dist/LICENSE.md +465 -0
- package/dist/compat.d.ts +113 -0
- package/dist/compat.js +215 -0
- package/dist/compat.js.map +1 -0
- package/dist/errors.d.ts +55 -0
- package/dist/errors.js +73 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/libhtml2realpdf.wasm +0 -0
- package/dist/page.d.ts +23 -0
- package/dist/page.js +54 -0
- package/dist/page.js.map +1 -0
- package/dist/pdf-document.d.ts +51 -0
- package/dist/pdf-document.js +107 -0
- package/dist/pdf-document.js.map +1 -0
- package/dist/preview.d.ts +74 -0
- package/dist/preview.js +369 -0
- package/dist/preview.js.map +1 -0
- package/dist/renderer.d.ts +64 -0
- package/dist/renderer.js +276 -0
- package/dist/renderer.js.map +1 -0
- package/dist/snapshot.d.ts +79 -0
- package/dist/snapshot.js +2972 -0
- package/dist/snapshot.js.map +1 -0
- package/dist/types.d.ts +273 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/dist/vendor/pdf.min.mjs +28 -0
- package/dist/vendor/pdf.worker.min.mjs +28 -0
- package/dist/wasm.d.ts +39 -0
- package/dist/wasm.js +176 -0
- package/dist/wasm.js.map +1 -0
- package/dist/worker.d.ts +1 -0
- package/dist/worker.js +30 -0
- package/dist/worker.js.map +1 -0
- package/package.json +57 -0
- package/skills/html2realpdf/SKILL.md +260 -0
- package/skills/html2realpdf/agents/openai.yaml +4 -0
package/dist/LICENSE.md
ADDED
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
# html2realpdf and third-party licenses
|
|
2
|
+
|
|
3
|
+
This file contains the license for html2realpdf and the notices and license
|
|
4
|
+
texts for third-party material bundled with, generated into, or adapted by this
|
|
5
|
+
repository. Development-only tools installed through package managers are not
|
|
6
|
+
redistributed by html2realpdf and retain the license files supplied by their
|
|
7
|
+
respective packages.
|
|
8
|
+
|
|
9
|
+
## License inventory
|
|
10
|
+
|
|
11
|
+
| Component | Use | License |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| html2realpdf | Project source and documentation | MIT |
|
|
14
|
+
| Noto Sans, Noto Sans Arabic, Noto Sans Hebrew, and the Noto Emoji-derived test fixture | Embedded and test font software | SIL Open Font License 1.1 |
|
|
15
|
+
| HarfBuzz | Bundled OpenType shaping engine | Old MIT |
|
|
16
|
+
| SheenBidi | Bundled Unicode Bidirectional Algorithm engine | Apache License 2.0 |
|
|
17
|
+
| PDF.js / pdfjs-dist | Bundled optional in-page PDF preview runtime | Apache License 2.0 |
|
|
18
|
+
| libunibreak | Bundled Unicode line-breaking engine | zlib |
|
|
19
|
+
| Unicode data files | Generated Unicode case-mapping and property tables | Unicode License v3 |
|
|
20
|
+
| Web Platform Tests scenarios | Adapted renderer-native conformance cases | BSD 3-Clause |
|
|
21
|
+
|
|
22
|
+
## html2realpdf - MIT License
|
|
23
|
+
|
|
24
|
+
Copyright (c) 2026 imggion
|
|
25
|
+
|
|
26
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
27
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
28
|
+
in the Software without restriction, including without limitation the rights
|
|
29
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
30
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
31
|
+
furnished to do so, subject to the following conditions:
|
|
32
|
+
|
|
33
|
+
The above copyright notice and this permission notice shall be included in all
|
|
34
|
+
copies or substantial portions of the Software.
|
|
35
|
+
|
|
36
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
37
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
38
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
39
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
40
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
41
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
42
|
+
SOFTWARE.
|
|
43
|
+
|
|
44
|
+
## Noto fonts - SIL Open Font License 1.1
|
|
45
|
+
|
|
46
|
+
Copyright 2018 The Noto Project Authors (github.com/googlei18n/noto-fonts)
|
|
47
|
+
|
|
48
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
49
|
+
This license is copied below, and is also available with a FAQ at:
|
|
50
|
+
https://openfontlicense.org
|
|
51
|
+
|
|
52
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
53
|
+
|
|
54
|
+
PREAMBLE
|
|
55
|
+
|
|
56
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
57
|
+
development of collaborative font projects, to support the font creation
|
|
58
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
59
|
+
open framework in which fonts may be shared and improved in partnership
|
|
60
|
+
with others.
|
|
61
|
+
|
|
62
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
63
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
64
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
65
|
+
redistributed and/or sold with any software provided that any reserved
|
|
66
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
67
|
+
however, cannot be released under any other type of license. The
|
|
68
|
+
requirement for fonts to remain under this license does not apply to any
|
|
69
|
+
document created using the fonts or their derivatives.
|
|
70
|
+
|
|
71
|
+
DEFINITIONS
|
|
72
|
+
|
|
73
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
74
|
+
Holder(s) under this license and clearly marked as such. This may include
|
|
75
|
+
source files, build scripts and documentation.
|
|
76
|
+
|
|
77
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
78
|
+
copyright statement(s).
|
|
79
|
+
|
|
80
|
+
"Original Version" refers to the collection of Font Software components as
|
|
81
|
+
distributed by the Copyright Holder(s).
|
|
82
|
+
|
|
83
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
84
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
85
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
86
|
+
new environment.
|
|
87
|
+
|
|
88
|
+
"Author" refers to any designer, engineer, programmer, technical writer or
|
|
89
|
+
other person who contributed to the Font Software.
|
|
90
|
+
|
|
91
|
+
PERMISSION & CONDITIONS
|
|
92
|
+
|
|
93
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
|
94
|
+
copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
95
|
+
redistribute, and sell modified and unmodified copies of the Font Software,
|
|
96
|
+
subject to the following conditions:
|
|
97
|
+
|
|
98
|
+
1) Neither the Font Software nor any of its individual components, in
|
|
99
|
+
Original or Modified Versions, may be sold by itself.
|
|
100
|
+
|
|
101
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
102
|
+
redistributed and/or sold with any software, provided that each copy
|
|
103
|
+
contains the above copyright notice and this license. These can be
|
|
104
|
+
included either as stand-alone text files, human-readable headers or in
|
|
105
|
+
the appropriate machine-readable metadata fields within text or binary
|
|
106
|
+
files as long as those fields can be easily viewed by the user.
|
|
107
|
+
|
|
108
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
109
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
110
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
111
|
+
presented to the users.
|
|
112
|
+
|
|
113
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
114
|
+
Software shall not be used to promote, endorse or advertise any Modified
|
|
115
|
+
Version, except to acknowledge the contribution(s) of the Copyright Holder(s)
|
|
116
|
+
and the Author(s) or with their explicit written permission.
|
|
117
|
+
|
|
118
|
+
5) The Font Software, modified or unmodified, in part or in whole, must be
|
|
119
|
+
distributed entirely under this license, and must not be distributed under
|
|
120
|
+
any other license. The requirement for fonts to remain under this license
|
|
121
|
+
does not apply to any document created using the Font Software.
|
|
122
|
+
|
|
123
|
+
TERMINATION
|
|
124
|
+
|
|
125
|
+
This license becomes null and void if any of the above conditions are not met.
|
|
126
|
+
|
|
127
|
+
DISCLAIMER
|
|
128
|
+
|
|
129
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
130
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
131
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
|
132
|
+
COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
133
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
134
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
135
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
136
|
+
OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS
|
|
137
|
+
IN THE FONT SOFTWARE.
|
|
138
|
+
|
|
139
|
+
## HarfBuzz - Old MIT License
|
|
140
|
+
|
|
141
|
+
HarfBuzz is licensed under the so-called "Old MIT" license. Details follow.
|
|
142
|
+
For parts of HarfBuzz that are licensed under different licenses see individual
|
|
143
|
+
files named COPYING in subdirectories where applicable.
|
|
144
|
+
|
|
145
|
+
Copyright © 2010-2022 Google, Inc.
|
|
146
|
+
Copyright © 2015-2020 Ebrahim Byagowi
|
|
147
|
+
Copyright © 2019,2020 Facebook, Inc.
|
|
148
|
+
Copyright © 2012,2015 Mozilla Foundation
|
|
149
|
+
Copyright © 2011 Codethink Limited
|
|
150
|
+
Copyright © 2008,2010 Nokia Corporation and/or its subsidiary(-ies)
|
|
151
|
+
Copyright © 2009 Keith Stribley
|
|
152
|
+
Copyright © 2011 Martin Hosken and SIL International
|
|
153
|
+
Copyright © 2007 Chris Wilson
|
|
154
|
+
Copyright © 2005,2006,2020,2021,2022,2023 Behdad Esfahbod
|
|
155
|
+
Copyright © 2004,2007,2008,2009,2010,2013,2021,2022,2023 Red Hat, Inc.
|
|
156
|
+
Copyright © 1998-2005 David Turner and Werner Lemberg
|
|
157
|
+
Copyright © 2016 Igalia S.L.
|
|
158
|
+
Copyright © 2022 Matthias Clasen
|
|
159
|
+
Copyright © 2018,2021 Khaled Hosny
|
|
160
|
+
Copyright © 2018,2019,2020 Adobe, Inc
|
|
161
|
+
Copyright © 2013-2015 Alexei Podtelezhnikov
|
|
162
|
+
|
|
163
|
+
For full copyright notices consult the individual files in the HarfBuzz
|
|
164
|
+
package.
|
|
165
|
+
|
|
166
|
+
Permission is hereby granted, without written agreement and without license or
|
|
167
|
+
royalty fees, to use, copy, modify, and distribute this software and its
|
|
168
|
+
documentation for any purpose, provided that the above copyright notice and
|
|
169
|
+
the following two paragraphs appear in all copies of this software.
|
|
170
|
+
|
|
171
|
+
IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR DIRECT,
|
|
172
|
+
INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE
|
|
173
|
+
OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE COPYRIGHT HOLDER HAS BEEN
|
|
174
|
+
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
175
|
+
|
|
176
|
+
THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
|
|
177
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
|
178
|
+
PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND
|
|
179
|
+
THE COPYRIGHT HOLDER HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
|
|
180
|
+
ENHANCEMENTS, OR MODIFICATIONS.
|
|
181
|
+
|
|
182
|
+
## SheenBidi and PDF.js - Apache License 2.0
|
|
183
|
+
|
|
184
|
+
SheenBidi copyright notice:
|
|
185
|
+
|
|
186
|
+
Copyright (C) 2014-2026 Muhammad Tayyab Akram
|
|
187
|
+
|
|
188
|
+
PDF.js is maintained by Mozilla and PDF.js contributors. Both SheenBidi and
|
|
189
|
+
the bundled `pdfjs-dist` runtime are distributed under the following license:
|
|
190
|
+
|
|
191
|
+
Apache License
|
|
192
|
+
Version 2.0, January 2004
|
|
193
|
+
http://www.apache.org/licenses/
|
|
194
|
+
|
|
195
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
196
|
+
|
|
197
|
+
1. Definitions.
|
|
198
|
+
|
|
199
|
+
"License" shall mean the terms and conditions for use, reproduction, and
|
|
200
|
+
distribution as defined by Sections 1 through 9 of this document.
|
|
201
|
+
|
|
202
|
+
"Licensor" shall mean the copyright owner or entity authorized by the
|
|
203
|
+
copyright owner that is granting the License.
|
|
204
|
+
|
|
205
|
+
"Legal Entity" shall mean the union of the acting entity and all other
|
|
206
|
+
entities that control, are controlled by, or are under common control with
|
|
207
|
+
that entity. For the purposes of this definition, "control" means (i) the
|
|
208
|
+
power, direct or indirect, to cause the direction or management of such
|
|
209
|
+
entity, whether by contract or otherwise, or (ii) ownership of fifty percent
|
|
210
|
+
(50%) or more of the outstanding shares, or (iii) beneficial ownership of
|
|
211
|
+
such entity.
|
|
212
|
+
|
|
213
|
+
"You" (or "Your") shall mean an individual or Legal Entity exercising
|
|
214
|
+
permissions granted by this License.
|
|
215
|
+
|
|
216
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
217
|
+
including but not limited to software source code, documentation source, and
|
|
218
|
+
configuration files.
|
|
219
|
+
|
|
220
|
+
"Object" form shall mean any form resulting from mechanical transformation
|
|
221
|
+
or translation of a Source form, including but not limited to compiled object
|
|
222
|
+
code, generated documentation, and conversions to other media types.
|
|
223
|
+
|
|
224
|
+
"Work" shall mean the work of authorship, whether in Source or Object form,
|
|
225
|
+
made available under the License, as indicated by a copyright notice that is
|
|
226
|
+
included in or attached to the work (an example is provided in the Appendix
|
|
227
|
+
below).
|
|
228
|
+
|
|
229
|
+
"Derivative Works" shall mean any work, whether in Source or Object form,
|
|
230
|
+
that is based on (or derived from) the Work and for which the editorial
|
|
231
|
+
revisions, annotations, elaborations, or other modifications represent, as a
|
|
232
|
+
whole, an original work of authorship. For the purposes of this License,
|
|
233
|
+
Derivative Works shall not include works that remain separable from, or merely
|
|
234
|
+
link (or bind by name) to the interfaces of, the Work and Derivative Works
|
|
235
|
+
thereof.
|
|
236
|
+
|
|
237
|
+
"Contribution" shall mean any work of authorship, including the original
|
|
238
|
+
version of the Work and any modifications or additions to that Work or
|
|
239
|
+
Derivative Works thereof, that is intentionally submitted to Licensor for
|
|
240
|
+
inclusion in the Work by the copyright owner or by an individual or Legal
|
|
241
|
+
Entity authorized to submit on behalf of the copyright owner. For the purposes
|
|
242
|
+
of this definition, "submitted" means any form of electronic, verbal, or
|
|
243
|
+
written communication sent to the Licensor or its representatives, including
|
|
244
|
+
but not limited to communication on electronic mailing lists, source code
|
|
245
|
+
control systems, and issue tracking systems that are managed by, or on behalf
|
|
246
|
+
of, the Licensor for the purpose of discussing and improving the Work, but
|
|
247
|
+
excluding communication that is conspicuously marked or otherwise designated
|
|
248
|
+
in writing by the copyright owner as "Not a Contribution."
|
|
249
|
+
|
|
250
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity on
|
|
251
|
+
behalf of whom a Contribution has been received by Licensor and subsequently
|
|
252
|
+
incorporated within the Work.
|
|
253
|
+
|
|
254
|
+
2. Grant of Copyright License. Subject to the terms and conditions of this
|
|
255
|
+
License, each Contributor hereby grants to You a perpetual, worldwide,
|
|
256
|
+
non-exclusive, no-charge, royalty-free, irrevocable copyright license to
|
|
257
|
+
reproduce, prepare Derivative Works of, publicly display, publicly perform,
|
|
258
|
+
sublicense, and distribute the Work and such Derivative Works in Source or
|
|
259
|
+
Object form.
|
|
260
|
+
|
|
261
|
+
3. Grant of Patent License. Subject to the terms and conditions of this
|
|
262
|
+
License, each Contributor hereby grants to You a perpetual, worldwide,
|
|
263
|
+
non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this
|
|
264
|
+
section) patent license to make, have made, use, offer to sell, sell, import,
|
|
265
|
+
and otherwise transfer the Work, where such license applies only to those
|
|
266
|
+
patent claims licensable by such Contributor that are necessarily infringed by
|
|
267
|
+
their Contribution(s) alone or by combination of their Contribution(s) with
|
|
268
|
+
the Work to which such Contribution(s) was submitted. If You institute patent
|
|
269
|
+
litigation against any entity (including a cross-claim or counterclaim in a
|
|
270
|
+
lawsuit) alleging that the Work or a Contribution incorporated within the Work
|
|
271
|
+
constitutes direct or contributory patent infringement, then any patent
|
|
272
|
+
licenses granted to You under this License for that Work shall terminate as of
|
|
273
|
+
the date such litigation is filed.
|
|
274
|
+
|
|
275
|
+
4. Redistribution. You may reproduce and distribute copies of the Work or
|
|
276
|
+
Derivative Works thereof in any medium, with or without modifications, and in
|
|
277
|
+
Source or Object form, provided that You meet the following conditions:
|
|
278
|
+
|
|
279
|
+
(a) You must give any other recipients of the Work or Derivative Works a copy
|
|
280
|
+
of this License; and
|
|
281
|
+
|
|
282
|
+
(b) You must cause any modified files to carry prominent notices stating that
|
|
283
|
+
You changed the files; and
|
|
284
|
+
|
|
285
|
+
(c) You must retain, in the Source form of any Derivative Works that You
|
|
286
|
+
distribute, all copyright, patent, trademark, and attribution notices from the
|
|
287
|
+
Source form of the Work, excluding those notices that do not pertain to any
|
|
288
|
+
part of the Derivative Works; and
|
|
289
|
+
|
|
290
|
+
(d) If the Work includes a "NOTICE" text file as part of its distribution,
|
|
291
|
+
then any Derivative Works that You distribute must include a readable copy of
|
|
292
|
+
the attribution notices contained within such NOTICE file, excluding those
|
|
293
|
+
notices that do not pertain to any part of the Derivative Works, in at least
|
|
294
|
+
one of the following places: within a NOTICE text file distributed as part of
|
|
295
|
+
the Derivative Works; within the Source form or documentation, if provided
|
|
296
|
+
along with the Derivative Works; or, within a display generated by the
|
|
297
|
+
Derivative Works, if and wherever such third-party notices normally appear.
|
|
298
|
+
The contents of the NOTICE file are for informational purposes only and do not
|
|
299
|
+
modify the License. You may add Your own attribution notices within Derivative
|
|
300
|
+
Works that You distribute, alongside or as an addendum to the NOTICE text from
|
|
301
|
+
the Work, provided that such additional attribution notices cannot be
|
|
302
|
+
construed as modifying the License.
|
|
303
|
+
|
|
304
|
+
You may add Your own copyright statement to Your modifications and may provide
|
|
305
|
+
additional or different license terms and conditions for use, reproduction, or
|
|
306
|
+
distribution of Your modifications, or for any such Derivative Works as a
|
|
307
|
+
whole, provided Your use, reproduction, and distribution of the Work otherwise
|
|
308
|
+
complies with the conditions stated in this License.
|
|
309
|
+
|
|
310
|
+
5. Submission of Contributions. Unless You explicitly state otherwise, any
|
|
311
|
+
Contribution intentionally submitted for inclusion in the Work by You to the
|
|
312
|
+
Licensor shall be under the terms and conditions of this License, without any
|
|
313
|
+
additional terms or conditions. Notwithstanding the above, nothing herein
|
|
314
|
+
shall supersede or modify the terms of any separate license agreement you may
|
|
315
|
+
have executed with Licensor regarding such Contributions.
|
|
316
|
+
|
|
317
|
+
6. Trademarks. This License does not grant permission to use the trade names,
|
|
318
|
+
trademarks, service marks, or product names of the Licensor, except as required
|
|
319
|
+
for reasonable and customary use in describing the origin of the Work and
|
|
320
|
+
reproducing the content of the NOTICE file.
|
|
321
|
+
|
|
322
|
+
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
|
|
323
|
+
writing, Licensor provides the Work (and each Contributor provides its
|
|
324
|
+
Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
325
|
+
KIND, either express or implied, including, without limitation, any warranties
|
|
326
|
+
or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
327
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
328
|
+
appropriateness of using or redistributing the Work and assume any risks
|
|
329
|
+
associated with Your exercise of permissions under this License.
|
|
330
|
+
|
|
331
|
+
8. Limitation of Liability. In no event and under no legal theory, whether in
|
|
332
|
+
tort (including negligence), contract, or otherwise, unless required by
|
|
333
|
+
applicable law (such as deliberate and grossly negligent acts) or agreed to in
|
|
334
|
+
writing, shall any Contributor be liable to You for damages, including any
|
|
335
|
+
direct, indirect, special, incidental, or consequential damages of any
|
|
336
|
+
character arising as a result of this License or out of the use or inability to
|
|
337
|
+
use the Work (including but not limited to damages for loss of goodwill, work
|
|
338
|
+
stoppage, computer failure or malfunction, or any and all other commercial
|
|
339
|
+
damages or losses), even if such Contributor has been advised of the
|
|
340
|
+
possibility of such damages.
|
|
341
|
+
|
|
342
|
+
9. Accepting Warranty or Additional Liability. While redistributing the Work
|
|
343
|
+
or Derivative Works thereof, You may choose to offer, and charge a fee for,
|
|
344
|
+
acceptance of support, warranty, indemnity, or other liability obligations
|
|
345
|
+
and/or rights consistent with this License. However, in accepting such
|
|
346
|
+
obligations, You may act only on Your own behalf and on Your sole
|
|
347
|
+
responsibility, not on behalf of any other Contributor, and only if You agree
|
|
348
|
+
to indemnify, defend, and hold each Contributor harmless for any liability
|
|
349
|
+
incurred by, or claims asserted against, such Contributor by reason of your
|
|
350
|
+
accepting any such warranty or additional liability.
|
|
351
|
+
|
|
352
|
+
END OF TERMS AND CONDITIONS
|
|
353
|
+
|
|
354
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
355
|
+
|
|
356
|
+
To apply the Apache License to your work, attach the following boilerplate
|
|
357
|
+
notice, with the fields enclosed by brackets "[]" replaced with your own
|
|
358
|
+
identifying information. (Don't include the brackets!) The text should be
|
|
359
|
+
enclosed in the appropriate comment syntax for the file format. We also
|
|
360
|
+
recommend that a file or class name and description of purpose be included on
|
|
361
|
+
the same "printed page" as the copyright notice for easier identification
|
|
362
|
+
within third-party archives.
|
|
363
|
+
|
|
364
|
+
Copyright [yyyy] [name of copyright owner]
|
|
365
|
+
|
|
366
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
367
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
368
|
+
License at
|
|
369
|
+
|
|
370
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
371
|
+
|
|
372
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
373
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
374
|
+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
375
|
+
specific language governing permissions and limitations under the License.
|
|
376
|
+
|
|
377
|
+
## libunibreak - zlib License
|
|
378
|
+
|
|
379
|
+
Copyright (C) Wu Yongwei <wuyongwei at gmail dot com>
|
|
380
|
+
Copyright (C) Tom Hacohen <tom at stosb dot com>
|
|
381
|
+
Copyright (C) Petr Filipsky <philodej at gmail dot com>
|
|
382
|
+
Copyright (C) Andreas Röver <roever at users dot sf dot net>
|
|
383
|
+
|
|
384
|
+
This software is provided 'as-is', without any express or implied warranty. In
|
|
385
|
+
no event will the author be held liable for any damages arising from the use of
|
|
386
|
+
this software.
|
|
387
|
+
|
|
388
|
+
Permission is granted to anyone to use this software for any purpose, including
|
|
389
|
+
commercial applications, and to alter it and redistribute it freely, subject
|
|
390
|
+
to the following restrictions:
|
|
391
|
+
|
|
392
|
+
1. The origin of this software must not be misrepresented; you must not claim
|
|
393
|
+
that you wrote the original software. If you use this software in a product,
|
|
394
|
+
an acknowledgement in the product documentation would be appreciated but is
|
|
395
|
+
not required.
|
|
396
|
+
2. Altered source versions must be plainly marked as such, and must not be
|
|
397
|
+
misrepresented as being the original software.
|
|
398
|
+
3. This notice may not be removed or altered from any source distribution.
|
|
399
|
+
|
|
400
|
+
## Unicode data files - Unicode License v3
|
|
401
|
+
|
|
402
|
+
UNICODE LICENSE V3
|
|
403
|
+
|
|
404
|
+
COPYRIGHT AND PERMISSION NOTICE
|
|
405
|
+
|
|
406
|
+
Copyright © 1991-2026 Unicode, Inc.
|
|
407
|
+
|
|
408
|
+
NOTICE TO USER: Carefully read the following legal agreement. BY DOWNLOADING,
|
|
409
|
+
INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR SOFTWARE, YOU
|
|
410
|
+
UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE TERMS AND CONDITIONS
|
|
411
|
+
OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY,
|
|
412
|
+
DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
|
|
413
|
+
|
|
414
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
415
|
+
data files and any associated documentation (the "Data Files") or software and
|
|
416
|
+
any associated documentation (the "Software") to deal in the Data Files or
|
|
417
|
+
Software without restriction, including without limitation the rights to use,
|
|
418
|
+
copy, modify, merge, publish, distribute, and/or sell copies of the Data Files
|
|
419
|
+
or Software, and to permit persons to whom the Data Files or Software are
|
|
420
|
+
furnished to do so, provided that either (a) this copyright and permission
|
|
421
|
+
notice appear with all copies of the Data Files or Software, or (b) this
|
|
422
|
+
copyright and permission notice appear in associated Documentation.
|
|
423
|
+
|
|
424
|
+
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
425
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
426
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD
|
|
427
|
+
PARTY RIGHTS.
|
|
428
|
+
|
|
429
|
+
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE
|
|
430
|
+
LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY
|
|
431
|
+
DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
432
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
|
433
|
+
CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR SOFTWARE.
|
|
434
|
+
|
|
435
|
+
Except as contained in this notice, the name of a copyright holder shall not be
|
|
436
|
+
used in advertising or otherwise to promote the sale, use or other dealings in
|
|
437
|
+
these Data Files or Software without prior written authorization of the
|
|
438
|
+
copyright holder.
|
|
439
|
+
|
|
440
|
+
## Adapted Web Platform Tests - BSD 3-Clause License
|
|
441
|
+
|
|
442
|
+
Copyright © web-platform-tests contributors
|
|
443
|
+
|
|
444
|
+
Redistribution and use in source and binary forms, with or without
|
|
445
|
+
modification, are permitted provided that the following conditions are met:
|
|
446
|
+
|
|
447
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
448
|
+
list of conditions and the following disclaimer.
|
|
449
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
450
|
+
this list of conditions and the following disclaimer in the documentation
|
|
451
|
+
and/or other materials provided with the distribution.
|
|
452
|
+
3. Neither the name of the copyright holder nor the names of its contributors
|
|
453
|
+
may be used to endorse or promote products derived from this software
|
|
454
|
+
without specific prior written permission.
|
|
455
|
+
|
|
456
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
457
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
458
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
459
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
|
460
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
461
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
462
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
463
|
+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
464
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
465
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/dist/compat.d.ts
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PDF-oriented html2pdf.js compatibility chain over the native renderer.
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
import { PdfDocument } from "./pdf-document.js";
|
|
7
|
+
import type { Html2PdfOptions, HtmlSource, PdfOutputType } from "./types.js";
|
|
8
|
+
/**
|
|
9
|
+
* Stateful, Promise-like compatibility chain.
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* The worker caches one `PdfDocument` until its source or options change.
|
|
13
|
+
* Raster-only html2pdf.js stages fail explicitly rather than silently changing
|
|
14
|
+
* the native PDF model.
|
|
15
|
+
*/
|
|
16
|
+
export declare class CompatWorker implements PromiseLike<PdfDocument> {
|
|
17
|
+
private source?;
|
|
18
|
+
private options;
|
|
19
|
+
private pdfPromise;
|
|
20
|
+
private tail;
|
|
21
|
+
/** Sets the HTML source; canvas and image input stages are unsupported. */
|
|
22
|
+
from(source: HtmlSource, type?: "string" | "element" | "canvas" | "img"): this;
|
|
23
|
+
/** Shallow-merges supported compatibility options and invalidates cached output. */
|
|
24
|
+
set(options: Html2PdfOptions): this;
|
|
25
|
+
/** Alias for `set`, retained for html2pdf.js chain compatibility. */
|
|
26
|
+
using(options: Html2PdfOptions): this;
|
|
27
|
+
/**
|
|
28
|
+
* Advances to PDF output for `pdf` or `container` targets.
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* The wrapper has no public intermediate container. A `container` target
|
|
32
|
+
* therefore schedules the PDF directly; canvas and image targets throw.
|
|
33
|
+
*/
|
|
34
|
+
to(target: "pdf" | "container" | "canvas" | "img"): this;
|
|
35
|
+
/** Schedules PDF rendering while preserving the fluent chain. */
|
|
36
|
+
toPdf(): this;
|
|
37
|
+
/** Compatibility no-op; no intermediate snapshot container is exposed. */
|
|
38
|
+
toContainer(): this;
|
|
39
|
+
/** Always throws because full-page canvas output is intentionally unsupported. */
|
|
40
|
+
toCanvas(): never;
|
|
41
|
+
/** Always throws because raster image output is intentionally unsupported. */
|
|
42
|
+
toImg(): never;
|
|
43
|
+
/** Schedules a browser download using the explicit or configured filename. */
|
|
44
|
+
save(filename?: string): this;
|
|
45
|
+
/** Alias for `save`. */
|
|
46
|
+
saveAs(filename?: string): this;
|
|
47
|
+
/**
|
|
48
|
+
* Resolves PDF output in a compatibility encoding.
|
|
49
|
+
*
|
|
50
|
+
* @remarks
|
|
51
|
+
* Blob URL outputs remain owned by the cached `PdfDocument`. Obtain it with
|
|
52
|
+
* `get("pdf")` to revoke the URL, or dispose the document when finished.
|
|
53
|
+
*/
|
|
54
|
+
outputPdf(type?: "blob"): Promise<Blob>;
|
|
55
|
+
outputPdf(type: "arraybuffer"): Promise<ArrayBuffer>;
|
|
56
|
+
outputPdf(type: StringPdfOutputType): Promise<string>;
|
|
57
|
+
outputPdf(type: PdfOutputType): Promise<ArrayBuffer | Blob | string>;
|
|
58
|
+
/** Routes generic html2pdf.js output requests to PDF output. */
|
|
59
|
+
output(type?: "blob", options?: unknown, source?: "pdf"): Promise<Blob>;
|
|
60
|
+
output(type: "arraybuffer", options?: unknown, source?: "pdf"): Promise<ArrayBuffer>;
|
|
61
|
+
output(type: StringPdfOutputType, options?: unknown, source?: "pdf"): Promise<string>;
|
|
62
|
+
output(type: PdfOutputType | undefined, options: unknown, source: "img"): Promise<never>;
|
|
63
|
+
output(type?: PdfOutputType, options?: unknown, source?: "pdf" | "img"): Promise<ArrayBuffer | Blob | string>;
|
|
64
|
+
/** Alias for `output`. */
|
|
65
|
+
export(type?: "blob", options?: unknown, source?: "pdf"): Promise<Blob>;
|
|
66
|
+
export(type: "arraybuffer", options?: unknown, source?: "pdf"): Promise<ArrayBuffer>;
|
|
67
|
+
export(type: StringPdfOutputType, options?: unknown, source?: "pdf"): Promise<string>;
|
|
68
|
+
export(type: PdfOutputType | undefined, options: unknown, source: "img"): Promise<never>;
|
|
69
|
+
export(type?: PdfOutputType, options?: unknown, source?: "pdf" | "img"): Promise<ArrayBuffer | Blob | string>;
|
|
70
|
+
/** Returns a rejected promise because raster image output is unsupported. */
|
|
71
|
+
outputImg(): Promise<never>;
|
|
72
|
+
/**
|
|
73
|
+
* Resolves the cached PDF for `pdf`, or a configured compatibility option for
|
|
74
|
+
* any other key, then optionally invokes the legacy callback.
|
|
75
|
+
*/
|
|
76
|
+
get(key: string, callback?: (value: unknown) => void): Promise<unknown>;
|
|
77
|
+
/** Interrupts a chain by throwing the supplied message as an `Error`. */
|
|
78
|
+
error(message: string): never;
|
|
79
|
+
/** Makes the chain awaitable and resolves it to the cached `PdfDocument`. */
|
|
80
|
+
then<TResult1 = PdfDocument, TResult2 = never>(onFulfilled?: ((value: PdfDocument) => TResult1 | PromiseLike<TResult1>) | null, onRejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
|
|
81
|
+
/** Compatibility alias for `then`. */
|
|
82
|
+
thenCore<TResult1 = PdfDocument, TResult2 = never>(onFulfilled?: ((value: PdfDocument) => TResult1 | PromiseLike<TResult1>) | null, onRejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
|
|
83
|
+
/** Compatibility alias for `then`. */
|
|
84
|
+
thenExternal<TResult1 = PdfDocument, TResult2 = never>(onFulfilled?: ((value: PdfDocument) => TResult1 | PromiseLike<TResult1>) | null, onRejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
|
|
85
|
+
/** Compatibility alias for `then`. */
|
|
86
|
+
run<TResult1 = PdfDocument, TResult2 = never>(onFulfilled?: ((value: PdfDocument) => TResult1 | PromiseLike<TResult1>) | null, onRejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
|
|
87
|
+
/** Handles a failed chain while preserving `PdfDocument` as the success type. */
|
|
88
|
+
catch<TResult = never>(onRejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null): Promise<PdfDocument | TResult>;
|
|
89
|
+
/** Compatibility alias for `catch`. */
|
|
90
|
+
catchExternal<TResult = never>(onRejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null): Promise<PdfDocument | TResult>;
|
|
91
|
+
private ensurePdf;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Creates an html2pdf.js-compatible PDF chain.
|
|
95
|
+
*
|
|
96
|
+
* @remarks
|
|
97
|
+
* Passing a source directly preserves html2pdf.js shorthand behavior and also
|
|
98
|
+
* schedules `save`. Call without a source when composing an explicit chain.
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```ts
|
|
102
|
+
* await html2pdf()
|
|
103
|
+
* .set({ filename: "invoice.pdf", margin: [10, 12] })
|
|
104
|
+
* .from(element)
|
|
105
|
+
* .save();
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
declare function html2pdf(source?: HtmlSource, options?: Html2PdfOptions): CompatWorker;
|
|
109
|
+
export default html2pdf;
|
|
110
|
+
declare namespace html2pdf {
|
|
111
|
+
export { CompatWorker as Worker };
|
|
112
|
+
}
|
|
113
|
+
type StringPdfOutputType = Exclude<PdfOutputType, "arraybuffer" | "blob">;
|