[Pkg-javascript-commits] [pdf.js] 147/174: Correctly handle /FitH destinations with `null` as the parameter
David Prévot
taffit at moszumanska.debian.org
Thu Nov 19 18:45:37 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository pdf.js.
commit e629882f2a43ac251d3767c2cee4c70506385783
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date: Tue Nov 10 11:13:44 2015 +0100
Correctly handle /FitH destinations with `null` as the parameter
According to http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf#G11.2095870, the vertical position shouldn't change if the parameter is `null`.
Fixes 6615.
---
web/pdf_viewer.js | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/web/pdf_viewer.js b/web/pdf_viewer.js
index cec51cf..0e4f973 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':
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git
More information about the Pkg-javascript-commits
mailing list