The code provided to create a text file produces a blank text file. The process to create a text file however works with running the command line argument. Here command line also produces the json and the text file.
let fs = require('fs'),
PDFParser = require("./pdf2json/PDFParser");
let pdfParser = new PDFParser();
pdfParser.on("pdfParser_dataError", errData => console.error(errData.parserError) );
pdfParser.on("pdfParser_dataReady", pdfData => {
fs.writeFile("./pdf2json/test/F1040EZ.content.txt", pdfParser.getRawTextContent());
});
pdfParser.loadPDF("./pdf2json/test/pdf/fd/form/F1040EZ.pdf");
my pdf file only contains text.
This has been also raised on the stackoverflow but no one has been able to resolve this.
Hope you can help.
Regards,
Jai