v1.3.0 — pdfnative 1.6.0: text extraction, form fill/flatten, encrypt/decrypt, native charts & page-tree password/streaming
pdfnative-cli v1.3.0
Released 2026-07-24
v1.3.0 surfaces the pdfnative 1.6.0 engine's additions on the CLI: five
new commands — extract-text, fill, encrypt, decrypt, and a
doctor preflight — plus native vector charts in render, fill --export
(read → edit → fill), and --password / --encrypt / --stream on the page-tree
commands. It unifies the render encryption flags with the page-tree vocabulary (and
fixes a silent render --encrypt no-op). For autonomous agents it adds a machine-readable
capability manifest (schema manifest + llms.txt) and the stable E_PASSWORD code.
Also lands PowerShell completion and a CLAUDE.md.
100% backward-compatible with v1.2.0 — every existing invocation keeps working.
⭐ Star
pdfnative— the
zero-dependency PDF engine that powers this CLI. Every star helps the
long-term project.
Highlights
- Text extraction (RAG/agent-native).
extract-textdecodes reading-order
Unicode text — as plain text, a JSON array, or NDJSON (one object per page)
— with--runs(positioned runs),--pages, and--password. No OCR. - Fill, flatten & export forms.
fill --data <values.json>fills an existing
AcroForm via an incremental save (an existing signature stays valid for its
revision);fill --flattenstamps appearances and removes interactive fields;
fill --exportdumps current values as a--data-shaped map for a
read → edit → fill round-trip. - Environment preflight.
doctorreports the CLI / Node /pdfnative
versions, Web Crypto (CSPRNG) availability — required byencrypt— and the
command count.--format json, exit 0/1: an ideal agent pre-flight. - Encrypt / decrypt.
encryptre-secures with AES-128/256 (CSPRNG-gated,
RC4 never emitted);decryptemits a plaintext copy. Passwords come from env
(winning over flags) and are never logged. - Native vector charts.
rendergains thechartdocument block — bar,
barH, line, pie, donut — as pure PDF path operators (zero deps, no
rasterisation), tagged/Figurewith alt text. - Encrypted & streaming page-tree ops.
merge/split/extractaccept
--password(encrypted sources),--encrypt [aes-128|aes-256](re-encrypt the
output), and--stream+--chunk-size(constant-memory output). - Richer inspection.
inspect --form-fieldslists AcroForm fields;
inspect --encryptionreports the scheme (algorithm, revision, opened-as);
--passwordopens encrypted documents. - Agent tool discovery.
schema manifestemits a machine-readable capability
manifest (commands, flags, error codes);llms.txtships the LLM-facing
version. New schema subjectsextract-text,fill,status.
What's new
New commands
extract-text
pdfnative extract-text --input report.pdf --format ndjson --runs > pages.ndjsonReading-order Unicode text via extractText. --format text|json|ndjson,
--pages, --runs, --password, --max-length, plus --summary/--fields.
No OCR — image-only pages yield empty text.
fill
pdfnative fill --input form.pdf --data values.json --output filled.pdf
pdfnative fill --input filled.pdf --flatten --output flat.pdf--data is a JSON map name → string|boolean|string[] (or { "values": {…} }).
Incremental save keeps existing signatures valid. Discover fields with
inspect --form-fields. Signature fields cannot be filled.
encrypt / decrypt
pdfnative encrypt --input in.pdf --owner-password "$OWNER" --algorithm aes-256 --stream --output enc.pdf
pdfnative decrypt --input enc.pdf --password "$USER" --output plain.pdfPage-tree re-encryption / transparent decryption. Both rebuild the page tree
(like merge), so signatures and form fields are dropped. encrypt requires a
Web Crypto CSPRNG; RC4 is never emitted. --stream (+ --chunk-size) processes
a large PDF at constant memory.
doctor
pdfnative doctor # human-readable
pdfnative doctor --format json # { ok, checks: [{ name, status, value, detail }] }Offline preflight of the CLI/Node/pdfnative versions, Web Crypto (CSPRNG), and command count.
render
- Native vector charts — the
chartdocument block (bar, barH, line, pie,
donut) renders as pure PDF path operators, multi-series with legend and nice
ticks, tagged/Figure+/Alt. Supplied via document JSON /--layout. - Unified encryption flags —
rendernow accepts--encrypt [aes-128|aes-256]/
--owner-password/--user-password/--permissions(same vocabulary as
merge/split/extract); the--encrypt-*flags remain as aliases.
merge / split / extract
--password— read encrypted source PDFs.--encrypt [aes-128|aes-256]with--owner-password/--user-password/
--permissions— re-encrypt the rebuilt output.--stream(+--chunk-size) — constant-memory streaming output.
inspect
--form-fields— list AcroForm fields (name, type, value, required/read-only, options).--encryption— report the encryption scheme, ornull.--password— open an encrypted PDF for inspection.
Agent / tooling
E_PASSWORDstable error code for a missing/incorrect PDF password.schema manifest— machine-readable capability manifest for tool discovery;
new subjectsextract-text,fill,status.llms.txtat the repo root.completion powershell— PowerShell completion (Register-ArgumentCompleter).CLAUDE.md— Claude Code contributor guide.
Compatibility
- Built on pdfnative
^1.6.0(was^1.5.0). - Node.js ≥ 20, Bun, Deno (
node dist/cli.cjs). - Zero extra runtime dependencies —
pdfnativeremains the sole dependency. - 100% backward-compatible with v1.2.0.
Security
- Passwords (
--password,--owner-password,--user-password) are read from
env (winning over flags) and are never logged or echoed in error messages. encrypt/ re-encryption require a Web Crypto CSPRNG and only emit AES; RC4 is
never produced. All new operations are memory-bounded (--max-length,
--max-output-size,--chunk-size) and safe on untrusted input.- No new network surface — the CLI stays offline by default.
Fixed
render --encryptwas a silent no-op — therender --helpadvertised
--encrypt aes-256 / --owner-password / …, but the code only read--encrypt-*
flags, sorender --encrypt aes-256 --owner-password Xproduced an unencrypted
PDF with no error.rendernow reads the unified flags (with--encrypt-*kept as
aliases), and the help text matches the implementation (including the watermark flags).schema/--versionin the published binary — the CLI version was
resolved with a bundle-relative../../package.jsonpath that does not exist
next to the flatteneddist/cli.cjs, so everyschema <subject>call on an
installed CLI failed withCannot find module '../../package.json'. Version
resolution now goes through a robust, name-guardedsrc/utils/version.ts.- Empty environment password no longer overrides a flag — an exported-but-empty
PDFNATIVE_PASSWORD/PDFNATIVE_ENCRYPT_*value used to win over an explicit
--password/--owner-password; an empty env value is now treated as absent. fillerror classification — malformed--datacontent now consistently
raisesE_INPUTat exit 1 (was a mix of exit 2 /E_USAGE).
Notes
extract-textperforms no OCR — pages with only images yield empty text.encrypt/decrypt(and page-tree re-encryption) rebuild the page tree, so
they drop signatures and form fields — use them before signing, not after.mergeuses one password for all sources. A single--passwordis applied to every
source; merging encrypted sources with different passwords fails withE_PASSWORD
(decrypt the outliers first).split/extracttake a single input, so this doesn't apply.- The global
--helpis now grouped by category (Create & edit / Page tree / Security /
Read & extract / Automation & meta) — display-only, no behaviour change. - Sign-side LTV (embedding timestamps /
/DSSat signing time) remains
upstream-blocked in pdfnative;sign --timestampstays reserved. See
ROADMAP.md and SECURITY.md. - On the roadmap (not in this release): a
batch --manifesttask orchestrator and a
comparecommand are feasible today; anoptimizecommand and a visualcompareawait
pdfnative primitives (object GC / linearisation / a rasteriser). See ROADMAP.md.