2

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?

  • it may be a limitation of `pdf2json`, possibly lack of unicode support. What are you trying to do with the file, perhaps you don't need to convert it to json. – mihai Oct 22 '18 at 19:28
  • @mihai Is there any other npm where I can get the pdf file content even if it in different language. – Easwar Moorthy Oct 23 '18 at 11:04

0 Answers0