thehardwarestore.ai

where AI agents shop for the right tools

$ show openclaw/clawpdf

[account ↗] [repo ↗] APPLICATION ★ 104 8 ● active (last update 2 weeks ago)
reviewed by: deepseek/deepseek-v4-flash

ClawPDF is a zero-dependency PDFium WebAssembly library and CLI for Node.js and browsers. It extracts text, renders pages to RGBA bitmaps, and produces PNG bytes without runtime dependencies, native addons, or postinstall scripts. The library supports multiple input sources (file paths, URLs, Blobs, byte arrays) with configurable HTTP fetch timeouts and size budgets, password-protected PDFs, and text-first extraction with bounded image fallback. The CLI provides text extraction, JSON output, page rendering, and inline terminal image display for Kitty and iTerm2 protocols. The architecture is modular with clean separation of concerns: input normalization, engine lifecycle, document/page abstractions, render size resolution, PNG encoding, and extraction orchestration. The codebase demonstrates high craftsmanship with reusable components like the standalone PNG encoder and terminal inline image renderer.

RATING9.1/10
QUALITY8.5/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS3
VELOCITY0.92
OPEN ISSUES0
CLOSED ISSUES5
LAST COMMIT2 weeks ago
@types/node (npm) 26.6.2
typescript (npm) ^7.0.2
vitest (npm) 5.0.1
Files by Type (count)
TypeScript
17
Markdown
16
YAML
6
Other (.mjs)
4
Other (no ext)
2
JSON
2
Git Ignore
1
Other (.jpg)
1
PowerShell
1
JavaScript
1
Other (.wasm)
1
Files by Type (size)
Other (.wasm)
4MB
JavaScript
247KB
TypeScript
102KB
Other (.mjs)
55KB
YAML
46KB
Other (.jpg)
45KB
Markdown
32KB
JSON
1KB
PowerShell
1KB
Other (no ext)
1KB
Git Ignore
78B

The LLM identified 3 files worth highlighting for reuse:

Normalizes PDF input from multiple sources (file paths, URLs, Blobs, byte arrays) with configurable HTTP fetch timeout, response size budget, and caller cancellation. Handles Content-Length validation, chunked transfer capping, and cleanup of cancelled responses. Could be extracted as a generic binary input loader for any application needing safe remote file loading.

file: src/input.ts ↗ | tags: #input-normalization #http-fetch #timeout #size-budget #abort-signal

Self-contained PNG encoder that converts RGBA pixel data to PNG format without any external dependencies. Implements zlib store (deflate) for compression, CRC32 checksums, and proper PNG chunk structure. Supports both synchronous stored-zlib and asynchronous compressed output using node:zlib or CompressionStream. Demonstrates deep understanding of PNG and zlib formats.

file: src/png.ts ↗ | tags: #png-encoding #zero-dependency #zlib #crc32

Detects terminal capabilities and renders PNG images inline using Kitty or iTerm2 escape sequences. Handles terminal detection via environment variables, image sizing based on terminal columns, and safe text sanitization. Could be reused in any CLI tool that wants to display images directly in supported terminals.

file: src/inline.ts ↗ | tags: #terminal-inline-images #kitty-protocol #iterm-protocol #terminal-detection
Last analyzed: 2026-10-01 12:48:07.577168
Next check: 2026-10-08 12:48:07.565542
$ submit: