I wrote #10797 but you closed it before I had time to respond. Here's my latest on this.
After upgrading to pdfjs-2.0.943-dist things still failed and I figured it was the same issues I was having with pdfjs-1.9.426-dist. Turns out it's not.
In pdfjs-2.0.943-dist, this code:
pdf.getPage(1).then(function(page) {
var viewport = page.getViewport({ scale: 1, });
});
returns this viewport:
I need the width and height so my code fails. I ran the above in a Chrome browser.
I then tried pdfjs-dist-master and things work fine in all platforms. I get this viewport:
pdfjs-dist-master partially solves my problem (I get the complete viewport and it works for me in all platforms) but it doesn't contain viewer.html so I rely on pdfjs-2.0.943-dist for the viewer. Between the two I get everything I need but I'd prefer to use one package for both pdf access and viewing.
If possible, please tell me:
Thank you
The method signature changed in PR #10369, hence:
2.0.943
and earlier it takes "regular" parameters, i.e. formatted as getViewport(scale, rotate, dontFlip)
.2.1.266
and later it takes an object, i.e. formatted as getViewport({ scale, rotation, dontFlip })
(This change should probably have been done a lot earlier, but it was overlooked previously.)
Most helpful comment
The method signature changed in PR #10369, hence:
2.0.943
and earlier it takes "regular" parameters, i.e. formatted asgetViewport(scale, rotate, dontFlip)
.2.1.266
and later it takes an object, i.e. formatted asgetViewport({ scale, rotation, dontFlip })
(This change should probably have been done a lot earlier, but it was overlooked previously.)