I am using the nodejs as a server in my application. I have used the pdfreader and pdfjson npm modules to read a pdf file.
my code is shown below:
let fs = require('fs'),
PDFParser = require("pdf2json");
let pdfParser = new PDFParser();
pdfParser.on("pdfParser_dataError", errData => console.error(errData.parserError) );
pdfParser.on("pdfParser_dataReady", pdfData => {
fs.writeFile("./pdf2json/test/F1040EZ.json", JSON.stringify(pdfData));
});
pdfParser.loadPDF("./sample.pdf");
I have read the file correctly. Now I was struck up with the files that contain different language files. My files may contain Japanese, and Indian languages like Hindi, Tamil, and Telugu.
I am not getting the different language after parsing. How can I read the different language and write to another file?