modern-pdf-lib 0.13.0 → 0.14.1
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 +13 -9
- package/dist/index.cjs +1227 -257
- package/dist/index.d.cts +405 -15
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +405 -15
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1222 -258
- package/dist/{pdfCatalog-CTfeeqtF.mjs → pdfCatalog-BB2Wnmud.mjs} +23 -9
- package/dist/{pdfCatalog-y_XG8Hq1.cjs → pdfCatalog-COKoYQ8C.cjs} +23 -9
- package/dist/{pdfPage-BebMv6fN.cjs → pdfPage-DBfdinTR.cjs} +42 -19
- package/dist/{pdfPage-B7vA518n.mjs → pdfPage-N1K2U3jI.mjs} +42 -19
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ Create, parse, fill, merge, sign, and manipulate PDF documents<br />in Node, Den
|
|
|
15
15
|
|
|
16
16
|
[](https://www.npmjs.com/package/modern-pdf-lib)
|
|
17
17
|
[](https://bundlephobia.com/package/modern-pdf-lib)
|
|
18
|
-
[](#)
|
|
19
19
|
[](#)
|
|
20
20
|
[](LICENSE)
|
|
21
21
|
|
|
@@ -90,7 +90,7 @@ const blob = await doc.saveAsBlob(); // Blob (browsers)
|
|
|
90
90
|
|
|
91
91
|
**Secure & Compliant**
|
|
92
92
|
- AES-256 / RC4 encryption & decryption
|
|
93
|
-
- Digital signatures (PKCS#7, timestamps)
|
|
93
|
+
- Digital signatures (PKCS#7, visible/invisible, timestamps)
|
|
94
94
|
- PDF/A-1b through PDF/A-3u validation
|
|
95
95
|
- Tagged PDF / PDF/UA accessibility
|
|
96
96
|
- Structure tree & marked content
|
|
@@ -168,7 +168,7 @@ const blob = await doc.saveAsBlob(); // Blob (browsers)
|
|
|
168
168
|
<td align="center">Copy pages only</td></tr>
|
|
169
169
|
|
|
170
170
|
<tr><td><strong>Annotations</strong></td>
|
|
171
|
-
<td align="center">
|
|
171
|
+
<td align="center">18 types + appearances</td>
|
|
172
172
|
<td align="center">No</td></tr>
|
|
173
173
|
|
|
174
174
|
<tr><td><strong>Streaming output</strong></td>
|
|
@@ -322,10 +322,14 @@ const bytes = await doc.save({
|
|
|
322
322
|
```ts
|
|
323
323
|
import { signPdf, verifySignatures } from 'modern-pdf-lib';
|
|
324
324
|
|
|
325
|
-
const signed = await signPdf(pdfBytes, {
|
|
326
|
-
certificate:
|
|
327
|
-
privateKey:
|
|
325
|
+
const signed = await signPdf(pdfBytes, 'Signature1', {
|
|
326
|
+
certificate: certDer,
|
|
327
|
+
privateKey: keyDer,
|
|
328
328
|
reason: 'Approved',
|
|
329
|
+
appearance: { // optional visible signature
|
|
330
|
+
rect: [50, 50, 200, 80],
|
|
331
|
+
fontSize: 10,
|
|
332
|
+
},
|
|
329
333
|
});
|
|
330
334
|
|
|
331
335
|
const results = await verifySignatures(signed);
|
|
@@ -420,7 +424,7 @@ modern-pdf-lib/
|
|
|
420
424
|
core/ PDF document model, objects, writer, pages
|
|
421
425
|
parser/ PDF loading, text extraction, content streams
|
|
422
426
|
form/ AcroForm fields (7 types) + appearances
|
|
423
|
-
annotation/
|
|
427
|
+
annotation/ 18 annotation types + appearance generators
|
|
424
428
|
accessibility/ Structure tree, marked content, PDF/UA checker
|
|
425
429
|
compliance/ PDF/A validation & enforcement
|
|
426
430
|
signature/ PKCS#7 signatures, timestamps, verification
|
|
@@ -431,7 +435,7 @@ modern-pdf-lib/
|
|
|
431
435
|
outline/ Bookmarks / document outline
|
|
432
436
|
metadata/ XMP metadata, viewer preferences
|
|
433
437
|
wasm/ Rust crate sources (5 modules)
|
|
434
|
-
tests/ 2,
|
|
438
|
+
tests/ 2,243 tests across 103 suites
|
|
435
439
|
docs/ VitePress documentation
|
|
436
440
|
```
|
|
437
441
|
|
|
@@ -443,7 +447,7 @@ modern-pdf-lib/
|
|
|
443
447
|
git clone https://github.com/ABCrimson/modern-pdf-lib.git
|
|
444
448
|
cd modern-pdf-lib
|
|
445
449
|
npm install
|
|
446
|
-
npm test # 2,
|
|
450
|
+
npm test # 2,243 tests
|
|
447
451
|
npm run typecheck # TypeScript 6.0 strict
|
|
448
452
|
npm run build # ESM + CJS + declarations
|
|
449
453
|
```
|