1// Installation
2// npm install pdf-parse
3
4// Basic Usage
5const fs = require('fs');
6const pdf = require('pdf-parse');
7let dataBuffer = fs.readFileSync('path to PDF file...');
8pdf(dataBuffer).then(function(data) {
9 /* number of pages
10 console.log(data.numpages);
11 number of rendered pages
12 console.log(data.numrender);
13 PDF info
14 console.log(data.info);
15 PDF metadata
16 console.log(data.metadata);
17 PDF.js version
18 check https://mozilla.github.io/pdf.js/getting_started/
19 console.log(data.version); PDF text console.log(data.text); */
20});