pdf2img-promises

阅读时长 5 分钟读完

A Node.js module for converting a pdf into an image file, using Promises

node-pdf2img-promises

A Node.js module for converting a pdf into an image file, using Promises.

This module is based on pdf2img by Fitra Aditya.

  • It was completely refactored to use async/await instead of callbacks
  • Error handling was improved
  • The async lib dependency was removed
  • An option to inform the desired image quality was implemented
  • The lib is now an EventEmitter, so you can listen to the file conversion progress

Dependencies

These dependencies must be installed on your server, as the gm package uses them:

  • GraphicsMagick
  • GhostScript

Installation

Usage

-- -------------------- ---- -------
----- --      - --------------
----- ----    - ----------------
----- ------- - ----------------------------

--- -----   - --------- - ------------
--- -------- - -------

--- --------- - --- ----------

-- --- ----- ------- -- -------- -- --- ---- ----
---------------------- ----- -- -
    ---------------------- -- -----
---

----------------------
  ----- ------                                -- --- -- ---- ------- ---
  ----- -----                                 -- ------- ----
  -------- ----                               -- ------- ---
  -------- ----                               -- ------- ---
  ---------- --------- - -------- - --------- -- ------ ------- ------- ---- --- ---- ------ ---- -- ---- ------ ------ ---- ---- -- ---- -----
  ----------- ---------                       -- ------ ---- ----- ------- ---- --- ---- ------ ---- -- ---- ------ ----- ---- ---- -- ----- -----
  ----- ----                                  -- ------- -------- ----- ------- ---- --- ---- ------ ---- -- ---- ------- --- ------
---

------------------------
  ---------- -- -
    ------------------
  --
  ---------- -- -
    -------------------
  --

It will return array of splitted and converted image files.

-- -------------------- ---- -------
- ------- ----------
  -------- 
   - - ----- --
       ----- -------------
       ----- -------
       ----- -------------------- --
     - ----- --
       ----- -------------
       ----- -------
       ----- -------------------- --
     - ----- --
       ----- -------------
       ----- -------
       ----- -------------------- - - -

Maintainer

Jon Ribeiro

License

MIT

HomePage

https://github.com/jonathas/node-pdf2img-promises

Repository

git+https://github.com/jonathas/node-pdf2img-promises.git

来源:JavaScript中文网 ,转载请注明来源 https://www.javascriptcn.com/post/6005681d81e8991b448e43ee

纠错
反馈