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 CHANGED
@@ -15,7 +15,7 @@ Create, parse, fill, merge, sign, and manipulate PDF documents<br />in Node, Den
15
15
 
16
16
  [![npm version](https://img.shields.io/npm/v/modern-pdf-lib?style=flat-square&color=cb3837)](https://www.npmjs.com/package/modern-pdf-lib)
17
17
  [![bundle size](https://img.shields.io/badge/gzip-36kb_core-blue?style=flat-square)](https://bundlephobia.com/package/modern-pdf-lib)
18
- [![tests](https://img.shields.io/badge/tests-2%2C199_passing-brightgreen?style=flat-square)](#)
18
+ [![tests](https://img.shields.io/badge/tests-2%2C243_passing-brightgreen?style=flat-square)](#)
19
19
  [![TypeScript](https://img.shields.io/badge/TypeScript-6.0-3178c6?style=flat-square&logo=typescript&logoColor=white)](#)
20
20
  [![License: MIT](https://img.shields.io/badge/license-MIT-yellow?style=flat-square)](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">16 types + appearances</td>
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: certPem,
327
- privateKey: keyPem,
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/ 16 annotation types + appearance generators
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,199 tests across 100 suites
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,199 tests
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
  ```