Skip to content
CAI
Software that uses CAICheck a score

parallax/jsPDF

42.8

Weak · 25 September 2026

50.3k

lines of production code

JavaScript

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a JavaScript library for generating PDF documents, structured with a modular plugin architecture that allows for granular feature selection. It provides core capabilities for creating PDFs from scratch, embedding images, and rendering HTML content via external converters. The library also supports advanced features such as AcroForm fields, text annotations, and mathematical equation rendering, with comprehensive tooling for testing and TypeScript integration.

How it got here

2009–2015 — Project initialization and example expansion

11 changes.

The project established its core build infrastructure and development tooling while significantly expanding its demonstration suite. This period focused on adding comprehensive examples for various jsPDF features, including HTML-to-PDF conversion, annotations, and outline generation, alongside corresponding test harnesses to validate plugin functionality.

2016–2018 — Modular architecture and modernization

7 changes.

The project underwent a significant architectural restructuring, refactoring the monolithic codebase into a modular plugin system with granular imports and ES module support. This modernization included adding native support for new image formats like BMP and WebP, introducing polyfills for broader browser compatibility, and updating the distribution to version 4.2.1 with various bug fixes. The period also saw the expansion of demonstration examples to showcase advanced rendering capabilities for charts and mathematical equations.

2019–2025 — TypeScript support and test expansion

7 changes.

This period focused on enhancing developer experience by introducing official TypeScript type definitions and expanding the example suite to cover modern build tools like Vite and PDF.js. Significant effort was also dedicated to robustness, adding comprehensive deployment tests across various module formats and environments, alongside expanded unit tests for core PDF generation features.

Features

Add Node.js examples for image embedding and non-Latin fonts

New example scripts have been added to the Node.js examples directory to demonstrate embedding images and rendering non-Latin text. Octocat.js shows how to load a PNG image and add it to a PDF document. The arabic.js and japanese.js examples demonstrate how to load custom TrueType fonts (Amiri and Mouhitsu) into the virtual file system and render Arabic and Japanese text respectively.

examples/node · high confidence

Add PDF.js example assets and build files

The examples/PDF.js directory now includes the necessary assets to run the PDF.js viewer, including the built JavaScript files (pdf.js, pdf.worker.js), the PDFObject helper library, web interface resources (debugger, images, locale files), and required CMap data files for character encoding support.

examples/PDF.js · high confidence

Add TypeScript type definitions and validation tests

The library now ships with a \types/index.d.ts\ file containing the public TypeScript interface definitions, making it easier to use jsPDF in TypeScript projects with proper autocomplete and type checking. To ensure these definitions remain accurate, the package includes \jspdf-tests.ts\ and \jspdf-tests-node.ts\ which validate the types against both ES module and CommonJS import patterns, along with corresponding \tsconfig\ files for running these checks.

types · high confidence

Added Vite compatibility example project

A new example project located at examples/vite demonstrates that jsPDF works correctly with the Vite build tool. This includes a test application that verifies ES module imports, PDF generation, and both development and production build compatibility, confirming the resolution of GitHub issue \#3851.

examples/vite · high confidence

Added jQuery 1.7.1 and jQuery UI 1.8.17 libraries to examples

The examples/js/jquery directory now includes the minified source files for jQuery v1.7.1 and jQuery UI v1.8.17. These libraries are added as new assets to support the basic examples site, enabling the use of these specific versions for UI interactions and DOM manipulation within the example applications.

examples/js/jquery · high confidence

Modernized demo page with live editor and Bootstrap styling

The examples directory has been restructured to include a modernized demo interface featuring a live code editor powered by the ACE library and styled with Bootstrap v3.3.7. This update introduces a split-pane layout allowing users to edit JavaScript and HTML in real-time with an instant preview, alongside new example scripts demonstrating AcroForm fields, text annotations, and Arabic text rendering.

examples/js · high confidence

New HTML2PDF example pages added

The examples/html2pdf directory now includes a comprehensive set of new demonstration pages (acid.html, acid2.html, auto\_break.html, lists.html, page\_break.html, pdf2.html, showcase.html, and others) that illustrate various HTML-to-PDF rendering capabilities, including CSS styling, list formatting, page breaks, and complex layouts.

examples/html2pdf · high confidence

New MathJax HTML example for PDF generation

Added a new example in the examples/MathJax directory that demonstrates rendering mathematical equations using MathJax and converting the resulting HTML page into a PDF using jsPDF and html2canvas. The example includes the necessary configuration for MathJax and a user interface button to trigger the PDF export.

examples/MathJax · high confidence

New canvg\_context2d examples for bar graphs and pie charts

The examples/canvg\_context2d directory now includes two new demonstration files: bar\_graph\_with\_text\_and\_lines.html and piechart.html. These examples show how to render complex SVG content, such as charts with legends and axis labels, into PDFs using the canvg library and the jsPDF context2d API.

_examples/canvg\context2d · high confidence

New jsPDF demo page with organized examples

The project introduces a new, organized demo page for jsPDF, featuring a tabbed interface that categorizes examples into Basic elements, Text elements, Graphic elements, and Using Fonts. This new layout includes specific demonstrations for creating two-page documents, landscape orientation, adding metadata, handling user input, adjusting font sizes and types, and setting text colors. The page also features a 'Fork me on GitHub' banner and utilizes jQuery UI for the interactive accordion and tab components.

examples · high confidence

Architecture

New modular plugin architecture for jsPDF

The library has been restructured from a monolithic build into a modular system where features are distributed as individual plugins in the \src/modules\ directory. This change introduces dedicated modules for core capabilities such as AcroForms (\acroform.js\), image handling (\addimage.js\, \bmp\_support.js\, \gif\_support.js\), HTML-to-PDF conversion (\html.js\), and a Canvas 2D API implementation (\context2d.js\). It also adds specialized modules for text layout (\cell.js\), annotations (\annotations.js\), and file loading with Node.js security controls (\fileloading.js\). Users will now interact with these features through a plugin-based API, allowing for more granular control over the library's footprint and functionality.

src/modules · high confidence

Project initialization and build infrastructure setup

The repository has been initialized with a complete build and development infrastructure. This includes configuration for Babel (ES6+ transpilation), ESLint (TypeScript-aware linting), Prettier (code formatting), and Rollup (module bundling). Essential project metadata and documentation files have been added, such as the MIT License, Code of Conduct, Contribution Guidelines, and Security Policy. The setup also defines the project structure via \modules.conf.js\ and provides a CLI tool (\cli.js\) and web interface (\builder.html\) for customizing library builds by selecting specific modules and image support.

(repo-wide) · high confidence

Project restructuring into modular source files

The source code has been reorganized from a single monolithic file into a modular structure. The main entry point (\src/index.js\) now imports and re-exports the core \jsPDF\ class along with individual feature modules (such as \acroform\, \addimage\, \html\, \context2d\, and various image format supports) from the \src/modules/\ directory. Additionally, core logic has been split into \src/jspdf.js\, while library utilities, polyfills, and license information are now housed in dedicated files (\src/libs/\, \src/polyfills.js\, \src/license.js\), improving maintainability and allowing for more granular imports.

src · high confidence

Behavioural changes

Font converter now supports ES module and UMD output formats

The font converter tool has been updated to allow users to choose between ES modules and UMD module formats when generating JavaScript font files. This change introduces a new 'Module format' selection in the UI and modifies the generated output to include the appropriate header for the selected format, enabling better integration with modern JavaScript build systems or legacy script loaders.

fontconverter · high confidence

Modernized library architecture with native browser polyfills and new image support

The library has been restructured to use ES modules and introduce a \globalObject\ abstraction, enabling safer access to browser globals like \atob\/\btoa\ and \console\ across different environments. This change includes new polyfills for \Blob\, \FileSaver\, and \URL\ to ensure compatibility with older browsers, while adding native support for BMP and WebP image formats via new decoders. Additionally, the codebase now exports specific utilities for PDF security (RC4/MD5 encryption) and font face normalization, replacing previous inline implementations with dedicated, modular files.

src/libs · high confidence

Removed external sprintf.js and base64.js library dependencies

The \libs/sprintf.js\ and \libs/base64.js\ files have been removed from the project. This eliminates the external dependencies on the sprintf string formatting library and the custom base64 encoding/decoding implementation, likely simplifying the build process and reducing the library's footprint by relying on native or alternative internal implementations.

libs · high confidence

Updated Smoothness theme styles for jQuery UI 1.8.17

The CSS file for the Smoothness theme in the examples directory has been updated to match the jQuery UI CSS Framework version 1.8.17. This change refreshes the visual appearance of UI components, including updated colors, borders, and background images for states like default, hover, active, highlight, and error, ensuring the example site's styling aligns with the latest framework release.

examples/css/smoothness · high confidence

jsPDF updated to version 4.2.1

The distribution files in the dist folder have been rebuilt and updated to version 4.2.1. This release includes the modernized output files and refactored testing infrastructure, along with fixes for converting large array buffers to strings (preventing 'Maximum call stack size exceeded' errors), correcting s6 imports related to svg2pdf, and ensuring safe usage of String.fromCharCode with multiple arguments.

dist · high confidence

Test coverage

Add deployment tests for AMD, ESM, globals, Node, TypeScript, and Web Workers; Added annotation test assets and examples; Added manual test pages for the Context2D plugin; Added test harness for the PDF outline plugin; Added test infrastructure configuration files; Expanded test coverage for PDF generation modules.

Dependencies

Add Vite example and update jsPDF package manifests

This change introduces a new Vite-based example application in the \examples/vite\ directory, providing a modern build setup for testing jsPDF with Vite 5.4.21. It also updates the main project's \package.json\ and \package-lock.json\ to version 4.2.1, upgrading runtime dependencies like \@babel/runtime\ to 7.28.6 and \fflate\ to 0.8.1, and updating dev dependencies such as \local-web-server\ to 5.4.0 and \@rollup/plugin-terser\ to 1.0.0.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 36 → 43 (+6.9)
  • Rubric changed (rubric-2026.08.15 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 41 → 27 (-14.2)
  • Architecture 100 (new)
  • Maturity 59 → 57 (-2.2)
  • Readiness 31 → 55 (+23.7)
  • Security 35 → 73 (+38.2)
  • Accessibility 50 (new)

Resolved (192)

  • (anonymous) (cognitive 43) (src/modules/annotations.js)
  • (anonymous) (cyclomatic 31) (src/modules/annotations.js)
  • Ad (cognitive 155) (src/libs/WebPDecoder.js)
  • Ad (cyclomatic 97) (src/libs/WebPDecoder.js)
  • Cd (cognitive 43) (src/libs/WebPDecoder.js)
  • Cd (cyclomatic 33) (src/libs/WebPDecoder.js)
  • Critical CVE: [GHSA redacted] (package-lock.json)
  • De (cognitive 29) (src/libs/WebPDecoder.js)
  • Dimension evaluation failed
  • FileTooLong: js/ace.js (examples/js/ace.js)
  • FileTooLong: modules/png_support.js (src/modules/png_support.js)
  • FileTooLong: specs/jspdf.unit.spec.js (test/specs/jspdf.unit.spec.js)
  • FileTooLong: web/viewer.js (examples/PDF.js/web/viewer.js)
  • GifReader (cyclomatic 44) (src/libs/omggif.js)
  • GifReaderLZWOutputIndexStream (cyclomatic 19) (src/libs/omggif.js)
  • GifWriter (cognitive 26) (src/libs/omggif.js)
  • GifWriter (cyclomatic 19) (src/libs/omggif.js)
  • GifWriterOutputLZWCodeStream (cognitive 20) (src/libs/omggif.js)
  • H (cognitive 33) (src/libs/WebPDecoder.js)
  • H (cyclomatic 19) (src/libs/WebPDecoder.js)
  • …and 172 more

New (499)

  • (anonymous) (cognitive 16) (src/modules/svg.js)
  • (anonymous) (cognitive 17) (src/libs/ttffont.js)
  • (anonymous) (cognitive 17) (src/libs/ttffont.js)
  • (anonymous) (cognitive 18) (src/modules/filters.js)
  • (anonymous) (cognitive 19) (src/libs/ttffont.js)
  • (anonymous) (cognitive 24) (src/libs/ttffont.js)
  • (anonymous) (cognitive 33) (src/modules/outline.js)
  • (anonymous) (cognitive 52) (src/modules/annotations.js)
  • (anonymous) (cognitive 64) (fontconverter/filereader.js)
  • (anonymous) (cyclomatic 17) (src/libs/ttffont.js)
  • (anonymous) (cyclomatic 21) (src/modules/outline.js)
  • (anonymous) (cyclomatic 21) (src/modules/standard_fonts_metrics.js)
  • (anonymous) (cyclomatic 25) (src/modules/fileloading.js)
  • (anonymous) (cyclomatic 27) (src/modules/filters.js)
  • (anonymous) (cyclomatic 35) (src/modules/utf8.js)
  • (anonymous) (cyclomatic 39) (src/modules/annotations.js)
  • (anonymous) (cyclomatic 54) (fontconverter/filereader.js)
  • (anonymous)::CmapEntry (cognitive 31) (src/libs/ttffont.js)
  • (anonymous)::Context2D::set (cognitive 24) (src/modules/context2d.js)
  • (anonymous)::Context2D::set (cyclomatic 19) (src/modules/context2d.js)
  • …and 479 more

Changes since last survey

  • 1 commits — 1 feature/other, 0 fixes

By area

  • (root) — 1 commit

Notable commits

  • change: docs: point README demo and docs links at GitHub Pages (#4008)

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

parallax/jsPDF was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 25 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 20d32998267745aa5336e299baa65d4f45916fb5 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-dd72cc24c749.