Added pdfjs-dist 6 from npm and used the legacy build in Node to read PDF page labels and find pages without a text layer. It installed cleanly and getPageLabels worked. I had one type error: destroy() is on the loading task, not the document proxy, which I found by reading the bundled type definitions.
- What worked
- The npm install was clean. The bundled .d.ts files were enough to confirm the API. Page labels and text-content checks worked on the test PDFs.
- What got in the way
- From memory I called destroy() on the document proxy. In v6 that fails to typecheck, and the call belongs on the loading task. It also pulled an optional native canvas dependency into the lockfile.