Most Efficient Way To Render A Viewport #19600
Unanswered
cmcnicholas
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I have some PDF's that require a very high level of detail.
We're implementing our own viewer layer and was wondering from those developing/using pdf.js what tricks and/or approaches have worked for you?
Specifically I was going to try and render a tile pyramid of detail (a bit like a slippy map / google map).
I am using
getViewport
with an appropriatescale
factor andoffsetX
andY
but what I'm unsure of is if pdf.js will only try to render what is "in viewport" and fits on the canvas (essentially cropping and avoiding objects outside the frame).A picture tells a thousand words, so the following is what I'm trying to answer.
"If a viewport is appropriately set and the canvas is the size of the orange area will pdf.js only attempt to render 'Lovely' or will it off-canvas attempt to render 'Hello World' too at negative coordinates?"
This will help me understand how much "extra" work is being done on a specific tile render.
Any input would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions