# pdf-figure-extractor

> Extract figure from pdf without text in it

Latest version **0.0.10** (published 2017-05-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install pdf-figure-extractor
pnpm add pdf-figure-extractor
yarn add pdf-figure-extractor
bun add pdf-figure-extractor
```

Provides the command `pdf-figure-extractor`.

## Health

**Score 5/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.10 |
| Published | 2017-05-31 |
| First published | 2017-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 14 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Corentin Labroche |
| Maintainers | iryu54 |

## Links

- npm: https://www.npmjs.com/package/pdf-figure-extractor
- npm.io page: https://npm.io/package/pdf-figure-extractor

## Dependencies (14)

- [gm](https://npm.io/package/gm.md) ^1.23.0
- [opn](https://npm.io/package/opn.md) ^5.0.0
- [chai](https://npm.io/package/chai.md) ^3.5.0
- [jimp](https://npm.io/package/jimp.md) ^0.2.27
- [mocha](https://npm.io/package/mocha.md) ^3.3.0
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [opencv](https://npm.io/package/opencv.md) ^6.0.0
- [rimraf](https://npm.io/package/rimraf.md) ^2.6.1
- [bluebird](https://npm.io/package/bluebird.md) ^3.5.0
- [loglevel](https://npm.io/package/loglevel.md) ^1.4.1
- [commander](https://npm.io/package/commander.md) ^2.9.0
- [easyimage](https://npm.io/package/easyimage.md) ^2.1.0
- [octachore](https://npm.io/package/octachore.md) git+https://github.com/Inist-CNRS/octachore.git#e13a41a0eab53f843f1b7d7f406e6b621e9f1a38
- [ghostscript-js](https://npm.io/package/ghostscript-js.md) ^1.0.3

## Recent versions

- 0.0.10 (latest) — 2017-05-31
- 0.0.9 — 2017-05-22
- 0.0.8 — 2017-05-19
- 0.0.7 — 2017-05-18
- 0.0.6 — 2017-05-18
- 0.0.5 — 2017-05-18
- 0.0.4 — 2017-05-18
- 0.0.3 — 2017-05-17
- 0.0.2 — 2017-05-17

## README

# Pdf-figure-extractor

Extract figure from pdf without text in it

#### Required Packages
Install dependencies:
``` bash
sudo apt-get install libopencv-dev libcv-dev libtesseract-dev  tesseract-ocr
```

***

### Installation

Install project dependencies:
``` bash
npm install
```

***

### Run

If you want to execute in command line interface:

``` bash
npm install -g pdf-figure-extractor
```
Usage:
``` bash
Usage: pdf-figure-extractor [options]

  Options:

    -h, --help             output usage information
    -V, --version          output the version number
    -o, --output <path>    Directory to put results
    -i, --input <path>     Directory to process
    -t, --tmp <path>       Directory to put temporary files
    -p, --partials <path>  Directory to put figure directory
```

For instance:

``` bash
pdf-figure-extractor --input "pdf" --output "output"
```

If you want to execute as a module:

``` javascript
const pfe = require('pdf-figure-extractor')

const config = {
  pdfInputPath: input,
  directoryOutputPath: output,
  directoryPartialPath: partials,
  tmp: tmp,
  debug:true
}
new pfe(config).then((self) => {
  return self.exec()
}).then((partials)=>{
  console.log(partials)
}).catch(err=>console.log(err))

```

***

### TODO

- ~~Extract array~~
- Extract graphs (partial: heritage from array when graph have grid inside)
- Extract images

---
_Source: https://npm.io/package/pdf-figure-extractor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
