https://github.com/fasatrix/pdf-to-text
A PDF to Text Extractor
https://github.com/fasatrix/pdf-to-text
Last synced: over 1 year ago
JSON representation
A PDF to Text Extractor
- Host: GitHub
- URL: https://github.com/fasatrix/pdf-to-text
- Owner: fasatrix
- License: apache-2.0
- Created: 2021-12-11T19:34:45.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-06-17T15:38:22.000Z (about 2 years ago)
- Last Synced: 2025-04-10T23:42:12.705Z (over 1 year ago)
- Language: TypeScript
- Size: 1.18 MB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# PDF-TO-TEXT
A pdf to text wrapper to extract text from a pdf. It works with searchable and non-searchable(images) PDFs

### Installation
`npm install text-from-pdf`
### Mac Users
`brew install poppler`
### Linux Users
`sudo apt-get update && sudo apt-get install poppler-utils`
### Windows Users
`No installation required`
### Usage
1) Standard Input PDF with horizontally aligned text:
```js
const text = await pdfToText('');
console.log(text)
```
2) Input PDF's with vertically aligned text:
```js
const options = {
rotationDegree: -90,
};
$ const text = await pdfToText('', options);
$ console.log(text)
```
3) Text from first and second page:
```js
const options = {
firstPageToConvert: 1,
lastPageToConvert: 2,
};
$ const text = await pdfToText('', options);
$ console.log(text)
```
4) Text from third to fifth page:
```js
const options = {
firstPageToConvert: 3,
lastPageToConvert: 5,
};
$ const text = await pdfToText('', options);
$ console.log(text)
```
4) Enable Progressbar logging:
```js
const options = {
firstPageToConvert: 1,
lastPageToConvert: 1,
enableProgressBarLogging: true
};
$ const text = await pdfToText('', options);
$ console.log(text)
```
## Features request
Fork, add your changes and create a pull request