Mozilla PDF.js is a comprehensive, web-standards-based PDF rendering library and viewer built entirely in JavaScript. It parses and renders PDF documents in the browser using HTML5 Canvas and SVG, with a worker thread for heavy parsing to keep the UI responsive. The library supports PDF versions 1.0 through 2.0, including encryption, digital signatures, XFA forms, Acrobat JavaScript scripting, and a full annotation editing suite (free text, ink, highlight, stamp, signature). It also provides a complete web viewer application with sidebar, find bar, presentation mode, and printing, plus a Chrome extension and Firefox integration. The architecture is modular: a core worker thread handles parsing, font rendering, and image decoding (using WebAssembly for JPEG2000, JBIG2, Brotli, and ICC color management), while the display layer manages canvas rendering, text extraction, and annotation overlays. The viewer layer provides UI components with an event bus for decoupled communication. The codebase demonstrates exceptional craftsmanship with clean abstractions (factory patterns, base classes, lazy initialization), extensive unit and integration tests, and a sophisticated build system that targets generic web, legacy browsers, Chrome, and Firefox. Key reusable patterns include a PostScript-to-typed-array compiler with fallback interpreter, a TrueType glyf table parser/writer, an operator list optimizer using state machines, a generic message handler for worker communication, and image processing utilities for signature extraction. The project is actively maintained with frequent commits, low technical drift, and a large community.
Sioyek is a cross-platform PDF viewer optimized for reading research papers and technical books. Built with Qt, OpenGL, and MuPDF, it provides a rich set of features including multi-threaded rendering, annotation management (highlights, bookmarks, portals, freehand drawings), SyncTeX integration for LaTeX forward/inverse search, fuzzy text search, and a customizable command-driven interface. The architecture follows a modular design with a central MainWidget orchestrating UI state, a Document model for PDF handling, a PdfRenderer for threaded rendering, and a DatabaseManager for persistent annotation storage. The application supports both desktop and touch-optimized interfaces, with platform-specific code for Windows, macOS, Linux, and Android. While primarily an application, Sioyek incorporates data-oriented features such as SQLite-based annotation persistence, checksum-based document identification, and integration with external research tools (Google Scholar, arXiv). The repository also includes scripts for paper downloading, text-to-speech, and embedding annotations, as well as precomputed embedding data files (embedding.npy, linear.npy) likely used for text summarization or search enhancement. The codebase demonstrates strong engineering practices with reusable components like a fuzzy matching library (fzf), a SyncTeX parser, a type-safe configuration system, and a set of QML touch UI widgets. However, it also exhibits some technical debt in the form of global state, large monolithic files (main_widget.h), and platform-specific conditionals scattered throughout.
This is an Android PDF viewer application built with Jetpack Compose that uses Mozilla's pdf.js library for rendering. The app displays PDFs in a sandboxed WebView with strict security policies, handles encrypted PDFs, provides navigation controls, outline viewing, document properties, and various UI features like zoom, rotation, and text layer visibility. The architecture follows MVVM with a ViewModel managing state and a Compose UI layer. The app uses content providers to securely load PDF content without granting the WebView access to files or network.
pdfme is a TypeScript monorepo for template-driven PDF generation and manipulation. In production it does three things: (1) generates PDF bytes from a JSON template plus input data using a plugin-based schema renderer (packages/generator + packages/schemas), (2) ships React widgets — Designer, Form, Viewer — for visually editing templates, filling forms, and previewing output (packages/ui), and (3) exposes a CLI (packages/cli) for headless generation, validation, diagnostics, and PDF conversion, plus a page-manipulation library (packages/manipulator) and an experimental JSX authoring layer (packages/jsx). The low-level PDF engine is a heavily extended, vendored fork of pdf-lib (packages/pdf-lib) with custom AcroForm appearance providers, SVG drawing, and font subsetting; fontkit provides glyph metrics, bwip-js renders barcodes, and @napi-rs/canvas powers Node-side raster conversion. A playground web app and Docusaurus documentation site are included as consumers. The core data flow is: Template + inputs are validated by shared Zod schemas (packages/common), then each schema plugin's pdfRender implementation draws into a pdf-lib document while a dynamic-layout engine computes split ranges, overflow expansion, and table/list pagination across pages. The same Plugin contract (pdf/ui/propPanel/icon) drives both PDF rendering and the WYSIWYG interface, so custom field types register once and work everywhere. Notable engineering: a sandboxed expression evaluator with prototype-pollution and XSS guards (common/expression.ts), SSRF-safe URL fetching with IPv4/IPv6/mapped-address checks (common/helper.ts), a from-scratch UAX #14 line-breaking engine with Japanese kinsoku handling (schemas/text/lineBreak.ts), and a safe inline-Markdown-to-rich-text parser. Weaknesses: the vendored pdf-lib fork contains dormant/commented API stubs and diverges from upstream, image-snapshot tests are brittle across rendering environments, several modules use module-level mutable caches, and some package version pins are aspirational (e.g., TypeScript ^7 in website). Repo-wide version coordination relies on internal packages pinned at 0.0.0 with * workspace deps. Overall the codebase is professional, well-tested (unit, integration, e2e, visual snapshots, security regression tests), actively maintained with CI publishing, and is an application — not a data/research project.