New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-76.92%
Maintainers
0
Weekly downloads
 
Created
Source

pdf2image

tag size
npm download jsdeliver

核心特色

PDF 轉換為圖片

  • 完美整合 pdf.js,實現快速解析與轉換 PDF 為圖片。
  • 支援多種圖片格式:jpg、png、webp。

壓縮下載

  • 結合 jszip.js,將所有生成的圖片打包成 ZIP 檔案,一鍵下載,操作便捷。
  • 自動命名檔案與壓縮檔,方便管理。

異步處理與錯誤處理

  • 使用異步設計保證流暢的用戶體驗。
  • 提供詳細的錯誤資訊,便於排查問題。

異步處理與錯誤處理

  • 使用異步設計保證流暢的用戶體驗。
  • 提供詳細的錯誤資訊,便於排查問題。

安裝方式

從 npm 安裝

npm i @pardnchiu/nanomd

從 CDN 引入

引入 pdf2image 套件
<script src="https://cdn.jsdelivr.net/npm/@pardnchiu/pdf2image@[VERSION]/dist/pdf2image.js"></script>
Module 版本
import { pdf2image } from "https://cdn.jsdelivr.net/npm/@pardnchiu/pdf2image@[VERSION]/dist/pdf2image.esm.js";

使用方法

初始化 pdf2image


const converter = new pdf2image({
    // filename: "" // String
    file: [file],   // 透過 input 取得 file.result;
    scale: 1.5,     // 大小縮放,預設 1.5
    type: "png"     // 輸出類型 [jpg|png|webp]
});

// 讀取 PDF 並轉換至圖片
converter.convert().then(images => {
    // do something
});

// 下載 PDF
converter.download();

授權條款

此源代碼項目採用 MIT 許可證授權。

開發者

邱敬幃 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