Skip to content

Commit f96ef52

Browse files
committed
Treat it as a slideshow if the width is greater than the height of the
page
1 parent 3a8add2 commit f96ef52

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

PDFViewerPlugin.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ function PDFViewerPlugin() {
218218
};
219219

220220
this.isSlideshow = function () {
221-
return false;
221+
// A very simple but generally true guess - if the width is greater than the height, treat it as a slideshow
222+
return pageWidth > pageHeight;
222223
};
223224

224225
this.onLoad = function () {};
@@ -255,7 +256,7 @@ function PDFViewerPlugin() {
255256
self.setZoomLevel(zoomLevel);
256257
};
257258

258-
this.fitToContainingElement = function (width, height) {
259+
this.fitToPage = function (width, height) {
259260
var zoomLevel = width / pageWidth;
260261
if (height / pageHeight < zoomLevel) {
261262
zoomLevel = height / pageHeight;

0 commit comments

Comments
 (0)