| // Auto-generated font data module — type declarations only (DO NOT EDIT) | ||
| // Source: tools/build-font-data.cjs — regenerate with build script | ||
| // | ||
| // Noto Emoji (monochrome / B&W) OFL-1.1 — for emoji rendering in PDF documents. | ||
| // Pure outline font (no color tables / COLRv1 / SVG / CBDT) so it embeds as a | ||
| // regular CIDFontType2 alongside Latin/Indic/CJK fonts. | ||
| // | ||
| // Wire via: | ||
| // registerFont('emoji', notoEmojiData) | ||
| // or pass directly through `PdfParams.fontEntries` / `DocumentParams.fontEntries`. | ||
| // `script-detect` will route emoji codepoints (U+1F300–U+1FAFF, U+2600–U+27BF, | ||
| // U+1F000–U+1F02F, U+1F0A0–U+1F0FF, plus skin-tone modifiers and ZWJ | ||
| // sequences) to this font. | ||
| // | ||
| // License: SIL Open Font License 1.1 (see fonts/LICENSE). | ||
| // @since 1.1.0 | ||
| export declare const metrics: { unitsPerEm: number; ascent: number; descent: number; capHeight: number; stemV: number; bbox: number[]; defaultWidth: number; numGlyphs: number; }; | ||
| export declare const fontName: string; | ||
| export declare const cmap: Record<number, number>; | ||
| export declare const defaultWidth: number; | ||
| export declare const widths: Record<number, number>; | ||
| export declare const gsub: Record<number, number>; | ||
| export declare const ligatures: Record<number, number[][]>; | ||
| export declare const markAnchors: Record<number, unknown>; | ||
| export declare const mark2mark: Record<string, unknown>; | ||
| export declare const pdfWidthArray: string; | ||
| export declare const ttfBase64: string; |
Sorry, the diff of this file is too big to display
| // Auto-generated font data module — type declarations only (DO NOT EDIT) | ||
| // Source: tools/build-font-data.cjs — regenerate with build script | ||
| // | ||
| // Noto Sans VF — Latin OFL-1.1 font intended for PDF/A Latin embedding. | ||
| // Use this module when generating PDF/A documents (`tagged: 'pdfa1b' | 'pdfa2b' | ||
| // | 'pdfa2u' | 'pdfa3b'`) where the 14 standard fonts are not embedded and | ||
| // therefore not strictly conforming. Wire via `registerFont('latin', notoSansData)` | ||
| // and pass the entry through `PdfParams.fontEntries`. | ||
| // | ||
| // License: SIL Open Font License 1.1 (see fonts/LICENSE). | ||
| // @since 1.1.0 | ||
| export declare const metrics: { unitsPerEm: number; ascent: number; descent: number; capHeight: number; stemV: number; bbox: number[]; defaultWidth: number; numGlyphs: number; }; | ||
| export declare const fontName: string; | ||
| export declare const cmap: Record<number, number>; | ||
| export declare const defaultWidth: number; | ||
| export declare const widths: Record<number, number>; | ||
| export declare const gsub: Record<number, number>; | ||
| export declare const ligatures: Record<number, number[][]>; | ||
| export declare const markAnchors: Record<number, unknown>; | ||
| export declare const mark2mark: Record<string, unknown>; | ||
| export declare const pdfWidthArray: string; | ||
| export declare const ttfBase64: string; |
Sorry, the diff of this file is too big to display
+2
-1
| { | ||
| "name": "pdfnative", | ||
| "version": "1.0.5", | ||
| "version": "1.1.0", | ||
| "description": "Zero-dependency native PDF generation library. 16 scripts (Arabic, Hebrew, Thai, CJK, Devanagari, Bengali, Tamil, Cyrillic, Greek, Georgian, Armenian, Latin), BiDi, PDF/A-1b/2b/3b, AES encryption, digital signatures, AcroForm, barcodes, SVG. Pure JavaScript ISO 32000-1 implementation.", | ||
@@ -87,2 +87,3 @@ "type": "module", | ||
| "qr-code", | ||
| "emoji", | ||
| "web-worker", | ||
@@ -89,0 +90,0 @@ "streaming", |
+49
-22
@@ -184,2 +184,7 @@ # pdfnative | ||
| ta: () => import('pdfnative/fonts/noto-tamil-data.js'), | ||
| // v1.1.0+ — optional Latin fallback for PDF/A documents with curly quotes, | ||
| // em-dash, ellipsis, etc. (activates automatically when needed): | ||
| latin: () => import('pdfnative/fonts/noto-sans-data.js'), | ||
| // v1.1.0+ — optional monochrome emoji: | ||
| emoji: () => import('pdfnative/fonts/noto-emoji-data.js'), | ||
| }); | ||
@@ -216,2 +221,4 @@ | ||
| | Tamil | `ta` | Noto Sans Tamil | GSUB ligatures + split vowels | | ||
| | Latin (PDF/A) | `latin` | Noto Sans VF | WinAnsi-extended Latin (curly quotes, em-dash, ellipsis…) | | ||
| | Emoji | `emoji` | Noto Emoji | Monochrome emoji (BMP/SMP, Fitzpatrick, ZWJ, VS-15/16) | | ||
@@ -374,3 +381,3 @@ ## Multi-Font (Mixed Scripts) | ||
| This creates **140+ PDF files** in `test-output/` (git-ignored), organized in twenty-three categories. | ||
| This creates **150+ PDF files** in `test-output/` (git-ignored), organized in twenty-five categories (including `emoji/` and `pdfa-latin/` added in v1.1.0). | ||
| See [scripts/README.md](scripts/README.md) for the modular generator architecture. | ||
@@ -820,16 +827,27 @@ | ||
| [`pdfnative-cli`](https://github.com/Nizoka/pdfnative-cli) is the **official CLI**. It exposes three commands — `render`, `sign`, `inspect` — for use in shell scripts, Makefiles, GitHub Actions, and Docker images. Zero extra runtime dependencies, npm-provenance-signed. | ||
| [`pdfnative-cli`](https://github.com/Nizoka/pdfnative-cli) v0.2.0 is the **official CLI**. It exposes four commands — `render`, `sign`, `inspect`, **`verify`** — covering the full `pdfnative` v1.0.5 surface for use in shell scripts, Makefiles, GitHub Actions, and Docker images. Zero extra runtime dependencies, npm-provenance-signed. | ||
| **Highlights (v0.2.0):** hybrid `flags + --layout file.json` model, encryption (AES-128/256), watermarks (text + image), header/footer page templates with `{page}/{pages}/{date}/{title}`, PDF/A-3 attachments (Factur-X / ZUGFeRD pattern), multilingual fonts via `--lang`, table-variant rendering, signing metadata + intermediate cert chains, `inspect --verbose/--pages/--check`, and a brand-new `verify` command for byte-range integrity and certificate-chain validation. **100 % backward-compatible** with v0.1.0. | ||
| ```bash | ||
| # render a JSON document spec to PDF | ||
| npx pdfnative-cli render document.json --output report.pdf | ||
| # render with full layout coverage (encryption + watermark + PDF/A-2b) | ||
| npx pdfnative-cli render --input doc.json --output report.pdf \ | ||
| --tagged pdfa2b --compress \ | ||
| --watermark-text "DRAFT" --watermark-opacity 0.15 | ||
| # sign an existing PDF (RSA or ECDSA, CMS/PKCS#7) | ||
| npx pdfnative-cli sign report.pdf --cert cert.pem --key key.pem --output signed.pdf | ||
| # sign with metadata and intermediate cert chain | ||
| npx pdfnative-cli sign --input report.pdf --output signed.pdf \ | ||
| --reason "Approved" --name "Finance Team" \ | ||
| --signing-time 2026-04-28T10:00:00Z \ | ||
| --cert-chain intermediate.pem | ||
| # inspect a PDF (page count, metadata, fonts, signatures) | ||
| npx pdfnative-cli inspect signed.pdf | ||
| # verify embedded signatures (byte-range + chain + trust) | ||
| npx pdfnative-cli verify --input signed.pdf --strict --trust ca-root.pem | ||
| # inspect with CI assertions (exit 1 on failure) | ||
| npx pdfnative-cli inspect --input signed.pdf \ | ||
| --check pdfa --check signed --format json | ||
| ``` | ||
| See the [CLI Guide](https://pdfnative.dev/guides/cli.html) for full reference, security model, and pipeline examples. | ||
| See the [CLI Guide](https://pdfnative.dev/guides/cli.html) for the full v0.2.0 reference, security model, recipes, and the `--conformance` → `--tagged` migration path. Try the [interactive CLI playground](https://pdfnative.dev/playgrounds/cli.html) to build commands without leaving the browser. | ||
@@ -938,3 +956,3 @@ ### pdfnative-mcp — Model Context Protocol server | ||
| scripts/ # Modular sample PDF generation (23 generators, 140+ PDFs) | ||
| tests/ # 1588+ tests (40 files: unit + integration + fuzz + parser) | ||
| tests/ # 1726+ tests (48 files: unit + integration + fuzz + parser) | ||
| bench/ # Performance benchmarks (vitest bench) | ||
@@ -953,3 +971,3 @@ ``` | ||
| npm run test:coverage # vitest with v8 coverage (95%+) | ||
| npm run test:generate # Generate 140+ sample PDFs → test-output/ | ||
| npm run test:generate # Generate 150+ sample PDFs → test-output/ | ||
| npm run lint # ESLint 9 + typescript-eslint strict | ||
@@ -1019,13 +1037,22 @@ npm run typecheck # tsc --noEmit (src/) | ||
| > **PDF/A status (v1.0.4).** As of v1.0.4 every PDF emits a trailer | ||
| > `/ID` and the `/Info CreationDate` is byte-equivalent to the | ||
| > `xmp:CreateDate` (with timezone offset) — closing two veraPDF | ||
| > reference-validator findings. **Latin font embedding** is **not yet | ||
| > implemented**: standard 14 Helvetica is still emitted as an | ||
| > unembedded reference, which veraPDF flags under ISO 19005-1 §6.3.4. | ||
| > Treat the `pdfaid:part` claim in XMP as aspirational until **v1.0.5** | ||
| > lands. See [docs/guides/pdfa.html](docs/guides/pdfa.html) and the | ||
| > tracking issue [release-notes/draft-issue-v1.0.5-latin-embedding.md](release-notes/draft-issue-v1.0.5-latin-embedding.md). | ||
| > Run `npm run validate:pdfa` locally (with veraPDF installed) to | ||
| > verify against the reference validator. | ||
| > **PDF/A status (v1.1.0).** Every PDF/A-claiming sample now passes | ||
| > the **veraPDF** reference validator (1b / 2b / 2u / 3b) when the | ||
| > Latin font module is registered. Trailer `/ID` and | ||
| > `/Info CreationDate` are byte-equivalent to `xmp:CreateDate` | ||
| > (with timezone offset). `<dc:title>`, `<dc:description>`, | ||
| > `<pdf:Keywords>` mirror `/Info /Title`, `/Subject`, `/Keywords` | ||
| > byte-for-byte (ISO 19005-1 §6.7.3 t1 / t4 / t5). Object 3 / Object 4 | ||
| > are emitted as Type0 redirector dicts pointing to the embedded | ||
| > CIDFontType2 chain — no more unembedded `Helvetica` references | ||
| > (ISO 19005-1 §6.3.4 / ISO 19005-2 §6.2.11.4.1). To produce strict | ||
| > PDF/A: | ||
| > | ||
| > ```ts | ||
| > import { registerFont } from 'pdfnative'; | ||
| > registerFont('latin', () => import('pdfnative/fonts/noto-sans-data.js')); | ||
| > ``` | ||
| > | ||
| > Run `npm run validate:pdfa` locally (with veraPDF installed, see | ||
| > [docs/guides/pdfa.html](docs/guides/pdfa.html)) to verify against | ||
| > the reference validator. CI runs veraPDF as a blocking check. | ||
@@ -1032,0 +1059,0 @@ ### PDF Encryption — Implemented ✅ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
67776156
9.51%53
8.16%80077
41.99%1219
2.27%