> [!NOTE]
> This README was generated by [SKILL](https://github.com/agenvoy/skill-readme-generate), get the ZH version from [here](https://github.com/pardnio/pdf2image/blob/main/doc/README.zh.md).

***

<p align="center">
<strong>TURN ANY PDF INTO IMAGES RIGHT IN THE BROWSER!</strong>
</p>

<p align="center">
<a href="https://www.npmjs.com/package/@pardnchiu/pdf2image"><img src="https://img.shields.io/npm/v/@pardnchiu/pdf2image?include_prereleases&style=for-the-badge" alt="npm"></a>
<a href="https://www.jsdelivr.com/package/npm/@pardnchiu/pdf2image"><img src="https://img.shields.io/jsdelivr/npm/hm/@pardnchiu/pdf2image?include_prereleases&style=for-the-badge" alt="Downloads"></a>
<a href="https://www.npmjs.com/package/@pardnchiu/pdf2image"><img src="https://img.shields.io/npm/l/@pardnchiu/pdf2image?include_prereleases&style=for-the-badge" alt="License"></a>
</p>

***

> A JavaScript browser library with PDF-to-image conversion, live progress overlay, and one-click ZIP download

## Table of Contents

- [Features](#features)
- [Architecture](#architecture)
- [License](#license)
- [Author](#author)

## Features

> `npm i @pardnchiu/pdf2image` · [Documentation](https://github.com/pardnio/pdf2image/blob/main/doc/doc.md)

- **Client-Side Conversion** — pdf.js renders each PDF page to PNG, JPG, or WebP inside the browser, so files never leave the user's machine.
- **Zero-Config Dependencies** — A single script tag preconnects to the CDN and loads pdf.js, JSZip, and the stylesheet automatically.
- **Concurrent Page Rendering** — All pages render to canvas in parallel, with an adjustable `scale` to trade quality for speed.
- **Built-in Progress Overlay** — Conversion and compression show a percentage overlay that switches between Chinese and English based on browser locale.
- **One-Click ZIP Download** — JSZip bundles the output images, and filenames accept a `yyyy-MM-DD hh:mm` date template.

## Architecture

> [Full Architecture](https://github.com/pardnio/pdf2image/blob/main/doc/architecture.md)

```mermaid
graph TB
    Script[pdf2image.js loaded] --> CDN[CDN dependency injection<br/>pdf.js / JSZip / CSS]
    App[Caller] --> Converter[pdf2image class]
    Converter -->|convert| PDFJS[pdf.js render<br/>canvas → Data URL]
    Converter -->|download| ZIP[JSZip bundle<br/>Blob download]
    PDFJS --> Loading[Progress overlay]
    ZIP --> Loading
    PDFJS --> Images[images array]
```

## License

This project is licensed under the [MIT LICENSE](https://github.com/pardnio/pdf2image/blob/main/LICENSE).

## Author

Just [open an issue](https://github.com/pardnchiu/pdf2image/issues/new) to share an idea.

<a href="https://github.com/pardnchiu/pdf2image/graphs/contributors">
  <img src="https://contrib.rocks/image?repo=pardnchiu/pdf2image&cache_bust=2026-10-04" alt="pdf2image contributors" />
</a>

***

©️ 2024 [邱敬幃 Pardn Chiu](https://www.linkedin.com/in/pardnchiu)
