diff --git a/chrome/content/zotero/reader.xul b/chrome/content/zotero/reader.xul index 1049602fa6..16ac27a6fa 100644 --- a/chrome/content/zotero/reader.xul +++ b/chrome/content/zotero/reader.xul @@ -157,6 +157,12 @@ label="&zotero.pdfReader.zoomPageWidth;" oncommand="menuCmd('zoomPageWidth')" /> + + diff --git a/chrome/content/zotero/xpcom/reader.js b/chrome/content/zotero/xpcom/reader.js index f037dd8e8a..e442f53d37 100644 --- a/chrome/content/zotero/xpcom/reader.js +++ b/chrome/content/zotero/xpcom/reader.js @@ -197,6 +197,10 @@ class ReaderInstance { isZoomPageWidthActive() { return this._iframeWindow.eval('PDFViewerApplication.pdfViewer.currentScaleValue === "page-width"'); } + + isZoomPageHeightActive() { + return this._iframeWindow.eval('PDFViewerApplication.pdfViewer.currentScaleValue === "page-fit"'); + } allowNavigateFirstPage() { return this._iframeWindow.eval('PDFViewerApplication.pdfViewer.currentPageNumber > 1'); @@ -499,6 +503,15 @@ class ReaderInstance { this._postMessage({ action: 'popupCmd', cmd: 'zoomPageWidth' }); }); popup.appendChild(menuitem); + // Zoom 'Page Height' + menuitem = this._window.document.createElement('menuitem'); + menuitem.setAttribute('label', Zotero.getString('pdfReader.zoomPageHeight')); + menuitem.setAttribute('type', 'checkbox'); + menuitem.setAttribute('checked', data.isZoomPageHeight); + menuitem.addEventListener('command', () => { + this._postMessage({ action: 'popupCmd', cmd: 'zoomPageHeight' }); + }); + popup.appendChild(menuitem); // Separator popup.appendChild(this._window.document.createElement('menuseparator')); // Next page @@ -1057,6 +1070,7 @@ class ReaderWindow extends ReaderInstance { this._window.document.getElementById('view-menuitem-hand-tool').setAttribute('checked', this.isHandToolActive()); this._window.document.getElementById('view-menuitem-zoom-auto').setAttribute('checked', this.isZoomAutoActive()); this._window.document.getElementById('view-menuitem-zoom-page-width').setAttribute('checked', this.isZoomPageWidthActive()); + this._window.document.getElementById('view-menuitem-zoom-page-height').setAttribute('checked', this.isZoomPageHeightActive()); } _onGoMenuOpen() { diff --git a/chrome/locale/en-US/zotero/zotero.dtd b/chrome/locale/en-US/zotero/zotero.dtd index f7cae08394..2d9f3bd24a 100644 --- a/chrome/locale/en-US/zotero/zotero.dtd +++ b/chrome/locale/en-US/zotero/zotero.dtd @@ -324,4 +324,5 @@ + diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties index 66c18073b8..2d201f3361 100644 --- a/chrome/locale/en-US/zotero/zotero.properties +++ b/chrome/locale/en-US/zotero/zotero.properties @@ -1369,6 +1369,7 @@ pdfReader.zoomIn = Zoom In pdfReader.zoomOut = Zoom Out pdfReader.zoomAuto = Automatically Resize pdfReader.zoomPageWidth = Zoom to Page Width +pdfReader.zoomPageHeight = Zoom to Page Height pdfReader.nextPage = Next Page pdfReader.previousPage = Previous Page pdfReader.page = Page