Documentation 1.1.0

Architecture

This page gives a one-diagram overview of pdf2image: dependency injection on load, the public pdf2image class, the internal progress overlay, and the CDN libraries they rely on.

System Overview

graph TB
    subgraph On load
        Boot[Bootstrap IIFE] --> Inject[Inject preconnect / preload / script / stylesheet]
    end
    subgraph CDN
        PDFJS[pdf.js 3.4.120<br/>+ worker + CMap]
        JSZip[JSZip 3.7.1]
        CSS[pdf2image.css @latest]
    end
    Inject --> PDFJS
    Inject --> JSZip
    Inject --> CSS
    App[Caller] --> Class[pdf2image]
    Class -->|convert| PDFJS
    PDFJS --> Canvas[canvas.toDataURL]
    Canvas --> Images[images array]
    Class -->|download| JSZip
    Images --> JSZip
    JSZip --> Anchor[a download click]
    Class --> Loading[pdf2imageLoading overlay]
    CSS --> Loading

Layers

Layer Component Responsibility
Load Bootstrap IIFE Attaches pdf.js, JSZip, and the stylesheet to <head>
Public API pdf2image class Normalizes options; convert(), download(), images
Internal UI pdf2imageLoading Creates and updates the progress overlay, switching labels by locale
External dependencies pdf.js, JSZip, browser APIs Parse and render the PDF, build the ZIP, trigger the download

Cross-Cutting Principles

Further Reading

中文