How lulzx/tinypdf works
tinypdf is a minimal, dependency-free PDF creation library. A caller creates a document, adds pages with drawing callbacks, then builds bytes or a stream; the separate Markdown helper lays out Markdown into pages using the same document API. The implementation is concentrated in src/index.ts; the graph separates its main runtime responsibilities. The README documents the broader feature set, while sampled excerpts show only selected internal calls.
Main entry points: index.ts Document builder
Components 7
Other components
- Library caller
- Document builder
src/index.ts - Page canvas
src/index.ts - Text metrics
src/index.ts - JPEG parser
src/index.ts - PDF serializer
src/index.ts - Markdown layout
src/index.ts
Connections 7
- Library caller → Document builder: creates document
README.md - Library caller → Markdown layout: converts Markdown
README.md - Document builder → Page canvas: adds pages
README.md - Page canvas → Text metrics: measures text
src/index.ts - Page canvas → JPEG parser: parses JPEG
src/index.ts - Document builder → PDF serializer: builds PDF
src/index.ts - Markdown layout → Document builder: creates document
src/index.ts