Hi,
I am trying to work with pdf2json package in meteor.I installed using meteor npm install command which completed successfully.But while calling the function from module is giving error.
import { Meteor } from 'meteor/meteor';
import fs from 'fs';
//import pdfParser from 'pdf2json';
pdfParser = Npm.require('pdf2json');
Future = Npm.require('fibers/future');
Meteor.startup(() => {
// code to run on server at startup
console.log("\n *START* \n");
future = new Future();
let pdfParser = new PDFParser();
//var content = fs.readFile("sample.pdf");
fs.readFile("sample.pdf", (err, pdfBuffer) => {
if (!err) {
//pdfParser.parseBuffer(pdfBuffer);
}
})
//console.log("Output Content : \n"+ content);
console.log("\n *EXIT* \n");
});
the error i am getting is
ReferenceError: PDFParser is not defined
W20170213-11:12:31.433(5.5)? (STDERR) at server/main.js:15:23
to check i added another npm package future, iam able to call its fuction properly.
Can anybody please help me with this?