can somebody please explain to me how I can actually use pdfjs-dist with next.js 14?
I am writing a webapp that needs to be able to parse pdfs, extract text and also take screenshots of the individual pages.
I am wondering whether or not the best approach would be to do that on the client or the server side. I would also like to know if it is even possible to run pdfdist-js on the client side because I am not able to get it working.
There's a pretty lengthy discussion over on Github issues where people have managed to get it working either on client:
Or server-side, via appDir (e.g.
app/api/pdf/route.js)I've personally just tested this last API-one on Next.js 14.1.1 and it works just fine after a
npm install pdfjs-dist