Good night people, I tell you.. I am working in node and express and I am getting the following error It turns out that my pdf at the moment has 3 pages, but it can vary. What I need to do is find a way to read the number of sheets that the PDF has, I'm using pdf.js.
So in summary: So what I need to do is do something in such a way that if the pdf has 3 pages, read me the 3 pages, if it has 4, read me the 4 pages and so on, I was reading the information that is https://mozilla.github.io /pdf.js/examples/ but it doesn't really fix much. Here's a picture of what I've done.
doc.numpages It returns the number of sheets, but when I use it by passing it to it, in this case, as numPages is = 3, it reads only the 3rd sheet