const fs = require('fs');
const PDFExtract = require('pdf.js-extract').PDFExtract;
const pdfExtract = new PDFExtract();
const options = {};
pdfExtract.extract('../Sizin Lombard Guideline.pdf', options, (err, data) => {
    if (err) return console.log(err);
    let text = "";
    data.pages.forEach(page => {
        page.content.forEach(item => {
            text += item.str + " ";
        });
        text += "\n";
    });
    fs.writeFileSync('output.txt', text);
    console.log("Done");
});
