Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pardnchiu/pdf2image

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pardnchiu/pdf2image

pdf2image is a lightweight JavaScript library to convert PDF pages into images (PNG, JPG, WebP) with real-time progress tracking and optional ZIP compression.

  • 1.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

pdf2image

tag size
npm download jsdeliver

Features

PDF to Images

  • Seamlessly integrates with pdf.js to efficiently parse PDFs and convert them into images.
  • Supports multiple image formats: jpg, png, webp for versatile usage.

Compressed Downloads

  • Leverages jszip.js to bundle generated images into a ZIP file for one-click download.
  • Automatically names files and ZIP archives for better organization of multipage content.

High Efficiency and Stability

  • Designed with asynchronous processing to ensure a smooth user experience.
  • Comprehensive error handling with detailed error messages for easier debugging.

Installation

Install via npm

npm i @pardnchiu/pdf2image

Include via CDN

UMD Version
<script src="https://cdn.jsdelivr.net/npm/@pardnchiu/pdf2image@[VERSION]/dist/pdf2image.js"></script>
ES Module Version
import { pdf2image } from "https://cdn.jsdelivr.net/npm/@pardnchiu/pdf2image@[VERSION]/dist/pdf2image.esm.js";

How to use

Initialize pdf2image

const converter = new pdf2image({
    filename: "image-yyyy-MM-DD_hh:mm", // Specify output filename, supports date format templates [yyyy|MM|DD|hh|mm]
    file: [file],                       // Input PDF file from file input or other sources
    scale: 1.5,                         // Scale factor, default is 1.5
    type: "png"                         // Output image format [jpg|png|webp]
});

// Convert PDF to images
converter.convert().then(images => {
    console.log("Successfully converted images:", images);
});

// Download compressed ZIP file
converter.download().then(() => {
    console.log("Images have been packed and downloaded!");
});

License

This source code project is licensed under the MIT License.

Creator

邱敬幃 Pardn Chiu

©️ 2024 邱敬幃 Pardn Chiu

Keywords

FAQs

Package last updated on 30 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc