diff --git a/web/pdf_viewer.js b/web/pdf_viewer.js index cec51cf35..0e4f97391 100644 --- a/web/pdf_viewer.js +++ b/web/pdf_viewer.js @@ -519,6 +519,12 @@ var PDFViewer = (function pdfViewer() { case 'FitBH': y = dest[2]; scale = 'page-width'; + // According to the PDF spec, section 12.3.2.2, a `null` value in the + // parameter should maintain the position relative to the new page. + if (y === null && this._location) { + x = this._location.left; + y = this._location.top; + } break; case 'FitV': case 'FitBV':