mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 18:25:37 +02:00
Ignore *negative* /FitH parameters in the viewer (issue 14385)
This provides a work-around for badly generated PDF documents that contain *negative* /FitH parameters (in the referenced issue the value `-32768` is used).
This commit is contained in:
parent
d3e1d7090a
commit
6b75e46d11
1 changed files with 1 additions and 1 deletions
|
@ -1173,7 +1173,7 @@ class BaseViewer {
|
||||||
if (y === null && this._location) {
|
if (y === null && this._location) {
|
||||||
x = this._location.left;
|
x = this._location.left;
|
||||||
y = this._location.top;
|
y = this._location.top;
|
||||||
} else if (typeof y !== "number") {
|
} else if (typeof y !== "number" || y < 0) {
|
||||||
// The "top" value isn't optional, according to the spec, however some
|
// The "top" value isn't optional, according to the spec, however some
|
||||||
// bad PDF generators will pretend that it is (fixes bug 1663390).
|
// bad PDF generators will pretend that it is (fixes bug 1663390).
|
||||||
y = pageHeight;
|
y = pageHeight;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue