Skip to content
Discussion options

You must be logged in to vote

hello@CODE-WITH-CODEER, pdf.js doesn’t have something like getTextContent() but for paths. If you want exact path geometry, getOperatorList() is the right place — there’s no simpler built-in that dumps SVG paths for you.

Those Float32Arrays are just numbers for the path / bbox in PDF user space. To use them you need to walk all operators (not only the one you filtered), and constructPath in canvas.js is the reference for how those arrays are meant to be read — basically you replay the same ops as the renderer and emit whatever format you want (SVG, etc.). That’s extra work, but it’s normal for this use case.

Layers / OCG on canvas vs SVG is a separate problem (visibility and draw order), …

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@CODE-WITH-CODEER
Comment options

Comment options

You must be logged in to vote
2 replies
@CODE-WITH-CODEER
Comment options

@Abdeltoto
Comment options

Answer selected by CODE-WITH-CODEER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants