You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
474 B
16 lines
474 B
const PDFExtract = require('pdf.js-extract').PDFExtract;
|
|
const pdfExtract = new PDFExtract();
|
|
const options = {};
|
|
|
|
const fs = require('fs');
|
|
|
|
var args = process.argv.slice(2)
|
|
//console.log(args)
|
|
if (args.length < 1) return console.log('missing input pdf filename');
|
|
|
|
const filename = args[0]
|
|
const output = filename+'_text.json'
|
|
pdfExtract.extract(filename, options, (err, data) => {
|
|
if (err) return console.log(err);
|
|
fs.writeFileSync(output, JSON.stringify(data) )
|
|
});
|
|
|