Operations with Mozilla PdfJs

taking into account the PDF that is displayed in the browser using pdfjs, are there functions to perform the following basic operations of the form:

  • Rotate
  • flip
  • increase

If not, what are the best strategies I can use to complete the operations above?

+5
source share
1 answer

You can set the rotation when you get an object of the form Viewport PdfPage:

var viewport = pdfPage.getViewport(scale, rotation);

If you want to set all the parameters at once, you can clone the viewport created with scale = 1:

var defaultViewport = pdfPage.getViewport(1);
var neededViewport = defaultViewport.clone({scale: needScale, rotation: needRotation, dontFlip: true});
+4
source

All Articles