diff --git a/chrome/content/zotero/reader.xhtml b/chrome/content/zotero/reader.xhtml index 31d4794446..770370e513 100644 --- a/chrome/content/zotero/reader.xhtml +++ b/chrome/content/zotero/reader.xhtml @@ -126,6 +126,25 @@ + + + + diff --git a/chrome/content/zotero/xpcom/reader.js b/chrome/content/zotero/xpcom/reader.js index 85409e1aef..41785fb733 100644 --- a/chrome/content/zotero/xpcom/reader.js +++ b/chrome/content/zotero/xpcom/reader.js @@ -389,6 +389,18 @@ class ReaderInstance { } return; } + else if (cmd === 'rotateLeft') { + await this._rotateCurrentPage(270); + return; + } + else if (cmd === 'rotateRight') { + await this._rotateCurrentPage(90); + return; + } + else if (cmd === 'rotate180') { + await this._rotateCurrentPage(180); + return; + } else if (cmd === 'splitVertically') { this._splitVertically(); } @@ -608,6 +620,13 @@ class ReaderInstance { return `data:image/svg+xml,`; } + async _rotateCurrentPage(degrees) { + let pageIndex = this._iframeWindow.wrappedJSObject.PDFViewerApplication.pdfViewer.currentPageNumber - 1; + this._postMessage({ action: 'reloading' }); + await Zotero.PDFWorker.rotatePages(this._itemID, [pageIndex], degrees, true); + await this.reload({ rotatedPageIndexes: [pageIndex] }); + } + _splitVertically() { if (this.isSplitVerticallyActive()) { this._iframeWindow.wrappedJSObject.unsplitView(); diff --git a/chrome/content/zotero/zoteroPane.xhtml b/chrome/content/zotero/zoteroPane.xhtml index e7c1013a61..caa0db2d17 100644 --- a/chrome/content/zotero/zoteroPane.xhtml +++ b/chrome/content/zotero/zoteroPane.xhtml @@ -273,6 +273,25 @@ + + + + + + +