Skip to content

Commit

Permalink
adding readme
Browse files Browse the repository at this point in the history
  • Loading branch information
人間失格 committed Oct 11, 2017
1 parent 673707e commit a97b4b7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
"author": "Jacob Baring <jacob@dnamicro.com>",
"dependencies": {
"bluebird": "^3.5.1",
"co": "^4.6.0",
"dotenv": "^4.0.0",
"fs-extra": "^4.0.2",
"gm": "^1.23.0"
},
Expand Down
23 changes: 23 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# PDF2Pic

Node module for converting PDF to image based on pdf2img by Fitra Adity

## Usage

```javascript
let PDF2Pic = require('pdf2pic')
let converter = new PDF2Pic({
density: 100,
savename: "untitled",
savedir: "./images"
})

converter.convert("/path/to/pdf/sample.pdf")
.then(resolve => {
console.log("image converted successfully")
})
```

___

This module is based on Fitra Adity's Great work.
6 changes: 6 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ class PDF2IMG {

}

/**
* Intialize converter
* @param {String} pdf_path path to file
* @param {Page} page page number to be converted (-1 for all pages)
* @return {Object} image status
*/
async convert(pdf_path, page = 1) {
this.isValidPDF(pdf_path)
this.fileExists(pdf_path)
Expand Down

0 comments on commit a97b4b7

Please sign in to comment.