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.
pdf-annotate.js is a JavaScript library that provides an annotation layer for PDF.js, enabling users to add various types of annotations (highlight, underline, strikethrough, freehand drawing, text boxes, points, shapes) to PDF documents. The library features a modular architecture with separate concerns for UI interactions, rendering, storage adapters, and accessibility. It integrates with PDF.js to render PDF pages and overlays annotation SVGs, handling coordinate transformations that account for viewport scaling and rotation. The library provides a storage adapter pattern for persisting annotations (with implementations for localStorage), comprehensive UI components for annotation creation and editing, and accessibility features for screen reader users through clever DOM manipulation techniques.