Reputation: 5087
given a PDF that is rendered in the browser using pdfjs, are there functions to do the following basic view operations:
If not, what are the best strategies I can use to do the operations above?
Upvotes: 6
Views: 2433
Reputation: 506
You can set rotation when you getting viewport form PdfPage object:
var viewport = pdfPage.getViewport(scale, rotation);
If you want to immediately set all the parameters, you can clone viewport, created with scale = 1:
var defaultViewport = pdfPage.getViewport(1);
var neededViewport = defaultViewport.clone({scale: needScale, rotation: needRotation, dontFlip: true});
Upvotes: 6