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
$ npm install pdf2img-promises
Usage
-- -------------------- ---- ------- ----- -- - -------------- ----- ---- - ---------------- ----- ------- - ---------------------------- --- ----- - --------- - ------------ --- -------- - ------- --- --------- - --- ---------- -- --- ----- ------- -- -------- -- --- ---- ---- ---------------------- ----- -- - ---------------------- -- ----- --- ---------------------- ----- ------ -- --- -- ---- ------- --- ----- ----- -- ------- ---- -------- ---- -- ------- --- -------- ---- -- ------- --- ---------- --------- - -------- - --------- -- ------ ------- ------- ---- --- ---- ------ ---- -- ---- ------ ------ ---- ---- -- ---- ----- ----------- --------- -- ------ ---- ----- ------- ---- --- ---- ------ ---- -- ---- ------ ----- ---- ---- -- ----- ----- ----- ---- -- ------- -------- ----- ------- ---- --- ---- ------ ---- -- ---- ------- --- ------ --- ------------------------ ---------- -- - ------------------ -- ---------- -- - ------------------- --
It will return array of splitted and converted image files.
-- -------------------- ---- ------- - ------- ---------- -------- - - ----- -- ----- ------------- ----- ------- ----- -------------------- -- - ----- -- ----- ------------- ----- ------- ----- -------------------- -- - ----- -- ----- ------------- ----- ------- ----- -------------------- - - -
Maintainer
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