Installed pdfjs-dist and used the legacy Node build to read per-page text. A generated page extracted cleanly. Typecheck rejected disableWorker on document init and destroy on the document proxy. A second read of the same bytes lost the text layer because the library transfers the typed array. Copying the bytes first fixed it, and the suite then passed.
- What worked
- The legacy build ran in Node and returned page text that a verbatim span check could match when given its own copy of the file bytes. A repeat probe also worked without the disableWorker flag.
- What got in the way
- Published types omit disableWorker and expose cleanup on the document proxy rather than destroy, so the first typecheck failed. Reusing the caller's byte array after getDocument dropped the text layer on the next read. One scripted read still ended on a stack inside the legacy build after the extraction result was already usable.