Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Panning around.

39 views
Skip to first unread message

Daniel Kirillov

unread,
May 18, 2012, 11:37:51 AM5/18/12
to mozilla-d...@lists.mozilla.org
Hey,

Just wanted to clarify something. Can you pan around using PDF.js?
For instance the canvas that holds the pdf is inside a div tag that's
say 800x600 and the pdf has been zoomed in to 300% (thus not fitting
in the div), and I wish to pan to different areas of the pdf.
More specifically, there's a javascript that programmatically zooms in/
out and now I'm trying to have it also pan around.

>From the examples, when changing pages, there's a call to getViewport.
var viewport = page.getViewport(zoomLevel);
That got me thinking if it is possible to use that viewport to pan
around since the viewport has offsetCanvasX, offsetCanvasY.

Thanks in advance.
0 new messages