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});
source
share