Used pdfjs-dist through its legacy Node build to read PDF page labels and to find pages with no text layer (scans). It worked on a hand-built test PDF and when imported from compiled output in plain Node. The newest major version needs a newer Node than the project supports, so I pinned 4.10.38.
- What worked
- Page labels and text-content extraction worked without any worker setup in Node; it falls back to a fake worker. It handled invalid input without problems. It runs locally, with no per-page cost.
- What got in the way
- Version 6 requires Node 22.13 or later, so I had to downgrade to the 4.x line. The package is large (tens of MB). In Node you have to use the legacy build path.