1 year ago
#236436
Nicholas Cerillo
Issue with running PDF.JS
I am looking to create a simple program that prints the text contents of a pdf file to the screen using the library pdf.js (https://www.npmjs.com/package/pdfjs-dist)
So far, I have an index.js file that is calling let PDFJS = require('pdfjs-dist');
I installed pdf.js using via the command 'npm i pdfjs-dist'. Problem is, as soon as I tried to run my index.js file 'run index.js' I am hit with the following error
/path/to/node_modules/pdfjs-dist/build/pdf.js:1361
await this._transport?.destroy();
^
SyntaxError: Unexpected token '.'
I'd like to know if anyone else had faced a similar issue when using pdf.js (will provide link) and if so, how to fix it? is there something that I require before using pdf.js?
any help would be very helpful.
node.js
npm
pdf.js
pdfjs-dist
0 Answers
Your Answer