New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getStructTree not available on es5 build? #13423
Comments
The last pre-release was is from April 5 and the struct tree logic was merged on April 9 (see #13171) so it's indeed not released. You'll have to wait until the next release, which is likely to happen in the coming week. |
Glad to hear that, thank you! |
I am trying to inspect what type of information getStructTree contains for a similar purpose. Unfortunately I'm getting null from this method. Any idea why it could be like that? I'm using rollup and commonjs to use this library import pdfjs from "pdfjs-dist"
import pdfjsWorker from "pdfjs-dist/build/pdf.worker.entry"
pdfjs.GlobalWorkerOptions.workerSrc = pdfjsWorker
let pdf = await pdfjs.getDocument("test.pdf").promise
let page = await pdf.getPage(3)
let tree = await page.getStructTree() tree is null |
@barsdeveloper Structure trees aren't available in every PDF. You can find more details as well as pointers to test cases (like fips-197.pdf) in issue #6269 |
Hello!
I'm trying to parse some PDFs in a Node application. In particular, I'm targeting some tables.
I see in the DOM of the web viewer rendering one of my documents that the
structTree
provides some really useful structural information that would make my life a lot easier, but thePage.getStructTree
method is not available onpdfjs-dist
es5 build that must be used in Node.js.Is there any other way I can get the struct tree information in Node?
Thanks!
The text was updated successfully, but these errors were encountered: