@pdfluent/node-win32-x64-msvc 1.1.0 → 1.3.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 +44 -24
- package/THIRD_PARTY_LICENSES.txt +84 -3
- package/index.win32-x64-msvc.node +0 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -49,7 +49,7 @@ const doc = await PdfDocument.openAsync(data);
|
|
|
49
49
|
|
|
50
50
|
const text = await doc.extractTextAsync(0);
|
|
51
51
|
const render = await doc.renderPageAsync(0, { dpi: 150 });
|
|
52
|
-
// render.data
|
|
52
|
+
// render.data - Buffer with RGBA pixels; render.width / render.height
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
### Open from file path
|
|
@@ -61,18 +61,18 @@ const doc = openPdf('/path/to/document.pdf');
|
|
|
61
61
|
|
|
62
62
|
## Features
|
|
63
63
|
|
|
64
|
-
- **Rendering**
|
|
65
|
-
- **Text extraction**
|
|
66
|
-
- **Text search**
|
|
67
|
-
- **Forms (AcroForm)**
|
|
68
|
-
- **Annotations**
|
|
69
|
-
- **Redaction**
|
|
70
|
-
- **Encryption**
|
|
71
|
-
- **Digital signatures**
|
|
72
|
-
- **Bookmarks**
|
|
73
|
-
- **PDF/A compliance**
|
|
74
|
-
- **Async API**
|
|
75
|
-
- **TypeScript**
|
|
64
|
+
- **Rendering** - rasterise pages to RGBA pixels at any DPI, generate thumbnails
|
|
65
|
+
- **Text extraction** - plain text per page or structured `TextBlockInfo[]` with coordinates
|
|
66
|
+
- **Text search** - returns page indices containing the query string
|
|
67
|
+
- **Forms (AcroForm)** - enumerate, read, and fill fields (text/checkbox/radio/choice); hierarchical names; appearance-stream regeneration
|
|
68
|
+
- **Annotations** - read existing annotations, add highlight / freetext
|
|
69
|
+
- **Redaction** - permanently remove text by search term
|
|
70
|
+
- **Encryption** - encrypt with AES-256, decrypt password-protected PDFs
|
|
71
|
+
- **Digital signatures** - validate existing signatures
|
|
72
|
+
- **Bookmarks** - read the document outline
|
|
73
|
+
- **PDF/A compliance** - validate against levels 1a/1b through 3a/3b/3u. This binding validates; it does not convert. PDF/A conversion is delivered at 1B, 2B and 3B, through the Rust facade, the WASM package and the C ABI
|
|
74
|
+
- **Async API** - Promise-based worker-thread execution; no event-loop blocking
|
|
75
|
+
- **TypeScript** - full `.d.ts` declarations with JSDoc included
|
|
76
76
|
|
|
77
77
|
## API reference
|
|
78
78
|
|
|
@@ -85,7 +85,7 @@ const doc = openPdf('/path/to/document.pdf');
|
|
|
85
85
|
| `PdfDocument.open(data: Buffer)` | Open synchronously from a Buffer |
|
|
86
86
|
| `PdfDocument.openAsync(data: Buffer)` | Open on a worker thread |
|
|
87
87
|
| `PdfDocument.openWithPassword(data, password)` | Open a password-protected PDF |
|
|
88
|
-
| `openPdf(path: string)` | Convenience wrapper
|
|
88
|
+
| `openPdf(path: string)` | Convenience wrapper - open from file path |
|
|
89
89
|
|
|
90
90
|
#### Metadata & structure
|
|
91
91
|
|
|
@@ -100,7 +100,7 @@ const geo = doc.pageGeometry(0); // { width, height, rotation }
|
|
|
100
100
|
```js
|
|
101
101
|
// Synchronous
|
|
102
102
|
const result = doc.renderPage(0, { dpi: 150 });
|
|
103
|
-
// result.data
|
|
103
|
+
// result.data - Buffer (RGBA), result.width, result.height
|
|
104
104
|
|
|
105
105
|
// Async (worker thread)
|
|
106
106
|
const result = await doc.renderPageAsync(0, { dpi: 300 });
|
|
@@ -122,11 +122,27 @@ const blocks = doc.extractTextBlocks(0); // TextBlockInfo[] with x/y/fontSize
|
|
|
122
122
|
const hits = doc.searchText('invoice'); // number[] of page indices
|
|
123
123
|
```
|
|
124
124
|
|
|
125
|
-
`extractMarkdown` runs
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
`extractMarkdown` runs `quality: "auto"` by default (since 1.3.0): the balanced
|
|
126
|
+
tier with TATR tables, and OCR for pages that have no text layer. When the
|
|
127
|
+
models are not installed it falls back to the `fast` tier and prints one
|
|
128
|
+
warning on stderr. Pass `quality: "fast"` for the 1.2 output, or
|
|
129
|
+
`quality: "balanced"` for the balanced tier alone (an error without the models);
|
|
130
|
+
`modelDir` and `tableModelDir` point the tiers at directories outside the
|
|
131
|
+
default. Install the models with `pdfluent models install layout tables`. See
|
|
128
132
|
[Quality tiers](../../docs/STRUCTURED_EXTRACTION.md#quality-tiers).
|
|
129
133
|
|
|
134
|
+
The wheel CLI installs the published own formula model with
|
|
135
|
+
`pdfluent models install formula`, including its NOTICE and training-data
|
|
136
|
+
provenance. Enable it with `formulaModel: true`.
|
|
137
|
+
|
|
138
|
+
The region model is opt-in and its assets are not published. Automatic
|
|
139
|
+
installation is unavailable; supply a complete model directory with its NOTICE.
|
|
140
|
+
With that package installed:
|
|
141
|
+
`extractMarkdown({ quality: "balanced", formulaLatex: true })` writes the layout
|
|
142
|
+
model's formula regions as `$...$` / `$$...$$` LaTeX, and `regionModel: true`
|
|
143
|
+
sends table regions the cheaper stages did not settle to the same model.
|
|
144
|
+
Without the model the output is unchanged and no error is raised.
|
|
145
|
+
|
|
130
146
|
#### Forms (AcroForm)
|
|
131
147
|
|
|
132
148
|
```js
|
|
@@ -142,9 +158,9 @@ const value = doc.getFieldValue('Address.Street');
|
|
|
142
158
|
// without /NeedAppearances processing.
|
|
143
159
|
// Read-only fields are rejected (throws).
|
|
144
160
|
doc.setFormField('Address.Street', '123 Main St');
|
|
145
|
-
doc.setFormField('Agree', 'On'); // checkbox
|
|
146
|
-
doc.setFormField('Country', 'NL'); // radio group
|
|
147
|
-
doc.setFormField('Category', 'Option2'); // combo/list
|
|
161
|
+
doc.setFormField('Agree', 'On'); // checkbox - pass the on-state name
|
|
162
|
+
doc.setFormField('Country', 'NL'); // radio group - pass the export value
|
|
163
|
+
doc.setFormField('Category', 'Option2'); // combo/list - pass the option value
|
|
148
164
|
|
|
149
165
|
// Multi-select list box: pass an array of option values. Writes /V as an
|
|
150
166
|
// array and rebuilds the sorted /I index cache (Acrobat-faithful).
|
|
@@ -181,10 +197,10 @@ doc.save('redacted.pdf');
|
|
|
181
197
|
#### Encryption
|
|
182
198
|
|
|
183
199
|
```js
|
|
184
|
-
// Encrypt
|
|
200
|
+
// Encrypt - saved copy is AES-256 protected; in-memory doc is unchanged
|
|
185
201
|
doc.encrypt('protected.pdf', 'secret');
|
|
186
202
|
|
|
187
|
-
// Decrypt
|
|
203
|
+
// Decrypt - works on a doc opened with openWithPassword
|
|
188
204
|
doc.decrypt('plain.pdf');
|
|
189
205
|
```
|
|
190
206
|
|
|
@@ -289,4 +305,8 @@ add-on). The two texts are `LICENSE` and `LICENSE-COMMERCIAL` in this package.
|
|
|
289
305
|
- **Pricing:** <https://pdfluent.com/sdk/pricing>
|
|
290
306
|
- **Support:** <https://pdfluent.com/support>
|
|
291
307
|
- **PDFluent editor** (source-available): <https://github.com/pdfluent/pdfluent>. The free desktop app this SDK powers.
|
|
292
|
-
- Built by [Innovation Trigger
|
|
308
|
+
- Built by [Innovation Trigger B.V.](https://pdfluent.com)
|
|
309
|
+
|
|
310
|
+
## Trademarks
|
|
311
|
+
|
|
312
|
+
PyMuPDF and MuPDF are trademarks of Artifex Software, Inc. PDFluent is an independent product of Innovation Trigger B.V. and is not affiliated with or endorsed by Artifex.
|
package/THIRD_PARTY_LICENSES.txt
CHANGED
|
@@ -133,8 +133,27 @@ Two vendored files, both Adobe's own CMap resources, both BSD-3-Clause:
|
|
|
133
133
|
form, read by the PDF/A fixups for
|
|
134
134
|
EUC-encoded CID text
|
|
135
135
|
Copyright 1990-2019 Adobe
|
|
136
|
+
crates/pdf-manip/resources/predefined-cmaps/pack.z
|
|
137
|
+
the 61 predefined CMaps of the PDF
|
|
138
|
+
specification as one compressed
|
|
139
|
+
pack, built by
|
|
140
|
+
scripts/pdfa/build_cmap_pack.py
|
|
141
|
+
from github.com/adobe-type-tools/
|
|
142
|
+
cmap-resources, commit f5cf3bca
|
|
143
|
+
(BSD-3-Clause); read by the PDF/A
|
|
144
|
+
conversion so it needs no
|
|
145
|
+
poppler-data on the host
|
|
146
|
+
Copyright 1990-2023 Adobe
|
|
147
|
+
crates/pdf-manip/resources/predefined-cmaps/PROVENANCE.sha256
|
|
148
|
+
ours: the SHA-256 of each source
|
|
149
|
+
file and of the pack built from
|
|
150
|
+
them
|
|
151
|
+
crates/pdf-manip/resources/predefined-cmaps/LICENSE-Adobe-CMap.txt
|
|
152
|
+
the full BSD-3-Clause text and
|
|
153
|
+
Adobe's notice for the pack above
|
|
136
154
|
|
|
137
155
|
Upstream licence texts in the tree:
|
|
156
|
+
crates/pdf-manip/resources/predefined-cmaps/LICENSE-Adobe-CMap.txt (BSD-3-Clause, full text)
|
|
138
157
|
crates/pdf-font/assets/LICENSE.txt (BSD-3-Clause, full text)
|
|
139
158
|
crates/pdf-manip/resources/cmap/GB-EUC-H (the notice is the file's own
|
|
140
159
|
header, as Adobe ships it)
|
|
@@ -321,7 +340,8 @@ unic-char-range, unic-common, unic-ucd-ident, unic-ucd-version, unicode-bidi,
|
|
|
321
340
|
unicode-normalization, unicode-properties, unicode-segmentation, unicode-width,
|
|
322
341
|
unicode-xid, url, utf-8, utf8_iter, utf8parse, uuid, vello_common, vello_cpu,
|
|
323
342
|
wasm-bindgen, wasm-bindgen-futures, wasm-bindgen-macro,
|
|
324
|
-
wasm-bindgen-macro-support, wasm-bindgen-shared, wasm-streams,
|
|
343
|
+
wasm-bindgen-macro-support, wasm-bindgen-shared, wasm-streams, wasmi, wasmi_collections, wasmi_core,
|
|
344
|
+
wasmi_ir, web-sys,
|
|
325
345
|
web-time, web_atoms, weezl, winapi, winapi-i686-pc-windows-gnu,
|
|
326
346
|
winapi-x86_64-pc-windows-gnu, window-vibrancy, windows, windows-collections,
|
|
327
347
|
windows-core, windows-future, windows-implement, windows-interface,
|
|
@@ -412,8 +432,7 @@ new_debug_unreachable, nom, nom_locate, noop_proc_macro, nu-ansi-term,
|
|
|
412
432
|
number_prefix, objc2, objc2-encode, objc2-foundation, open, openssl-sys,
|
|
413
433
|
os_pipe, pango, pango-sys, pdf-bench, pdf-desktop, pdf-diff, pdf-java,
|
|
414
434
|
pdfluent-lopdf, phf, phf_generator, phf_macros, phf_shared, plist,
|
|
415
|
-
precomputed-hash, quick-xml, redox_syscall, redox_users, rfd, rgb,
|
|
416
|
-
rquickjs-core, rquickjs-macro, rquickjs-sys, rusqlite, schannel, schemars,
|
|
435
|
+
precomputed-hash, quick-xml, redox_syscall, redox_users, rfd, rgb, rusqlite, schannel, schemars,
|
|
417
436
|
schemars_derive, sharded-slab, shared_child, sigchld, simd-adler32,
|
|
418
437
|
simd_helpers, slab, soup3, soup3-sys, spin, strsim, synstructure, tiff,
|
|
419
438
|
tokio, tokio-macros, tokio-native-tls, tokio-util, tower, tower-http,
|
|
@@ -731,6 +750,44 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
|
731
750
|
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
732
751
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
733
752
|
|
|
753
|
+
================================================================================
|
|
754
|
+
QuickJS-ng — the script engine, compiled into xfa-js-sandboxed's WebAssembly module
|
|
755
|
+
https://github.com/quickjs-ng/quickjs (version 0.7.0)
|
|
756
|
+
================================================================================
|
|
757
|
+
|
|
758
|
+
QuickJS (MIT) is a component of crates/xfa-js-sandboxed/wasm-guest/qjs_guest.wasm:
|
|
759
|
+
the module is compiled from the C sources in wasm-guest/quickjs/ (two changes,
|
|
760
|
+
listed in wasm-guest/PATCHES.md) and is interpreted by the wasmi crate. No native
|
|
761
|
+
C code runs. The module also contains code from wasi-libc (Apache-2.0 WITH
|
|
762
|
+
LLVM-exception; MIT and BSD-2-Clause parts derived from musl) and LLVM
|
|
763
|
+
compiler-rt (Apache-2.0 WITH LLVM-exception), linked in by the toolchain
|
|
764
|
+
(zig 0.16.0, build tooling only, not shipped). See wasm-guest/NOTICE.
|
|
765
|
+
|
|
766
|
+
The MIT License (MIT)
|
|
767
|
+
|
|
768
|
+
Copyright (c) 2017-2021 Fabrice Bellard
|
|
769
|
+
Copyright (c) 2017-2021 Charlie Gordon
|
|
770
|
+
Copyright (c) 2023 Ben Noordhuis
|
|
771
|
+
Copyright (c) 2023 Saúl Ibarra Corretgé
|
|
772
|
+
|
|
773
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
774
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
775
|
+
in the Software without restriction, including without limitation the rights
|
|
776
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
777
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
778
|
+
furnished to do so, subject to the following conditions:
|
|
779
|
+
|
|
780
|
+
The above copyright notice and this permission notice shall be included in
|
|
781
|
+
all copies or substantial portions of the Software.
|
|
782
|
+
|
|
783
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
784
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
785
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
786
|
+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
787
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
788
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
789
|
+
THE SOFTWARE.
|
|
790
|
+
|
|
734
791
|
================================================================================
|
|
735
792
|
tract — ONNX inference for the optional vision layer (#636)
|
|
736
793
|
https://github.com/sonos/tract
|
|
@@ -842,3 +899,27 @@ SOFTWARE
|
|
|
842
899
|
================================================================================
|
|
843
900
|
END OF THIRD PARTY LICENSES
|
|
844
901
|
================================================================================
|
|
902
|
+
|
|
903
|
+
================================================================================
|
|
904
|
+
qrcodegen 1.8.0 — QR Code generator library (MIT)
|
|
905
|
+
https://www.nayuki.io/page/qr-code-generator-library
|
|
906
|
+
================================================================================
|
|
907
|
+
|
|
908
|
+
Copyright (c) Project Nayuki. (MIT License)
|
|
909
|
+
https://www.nayuki.io/page/qr-code-generator-library
|
|
910
|
+
|
|
911
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
912
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
913
|
+
the Software without restriction, including without limitation the rights to
|
|
914
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
915
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
916
|
+
subject to the following conditions:
|
|
917
|
+
- The above copyright notice and this permission notice shall be included in
|
|
918
|
+
all copies or substantial portions of the Software.
|
|
919
|
+
- The Software is provided "as is", without warranty of any kind, express or
|
|
920
|
+
implied, including but not limited to the warranties of merchantability,
|
|
921
|
+
fitness for a particular purpose and noninfringement. In no event shall the
|
|
922
|
+
authors or copyright holders be liable for any claim, damages or other
|
|
923
|
+
liability, whether in an action of contract, tort or otherwise, arising from,
|
|
924
|
+
out of or in connection with the Software or the use or other dealings in the
|
|
925
|
+
Software.
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pdfluent/node-win32-x64-msvc",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"os": [
|
|
5
5
|
"win32"
|
|
6
6
|
],
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"THIRD_PARTY_LICENSES.txt",
|
|
18
18
|
"README.md"
|
|
19
19
|
],
|
|
20
|
-
"description": "PDF SDK for Node.js
|
|
20
|
+
"description": "PDF SDK for Node.js - find and replace PDF text while preserving fonts and layout, plus rendering, text extraction, forms, annotations, redaction, encryption, and PDF/A compliance.",
|
|
21
21
|
"keywords": [
|
|
22
22
|
"pdf",
|
|
23
23
|
"pdf-text-replace",
|