Skip to content

Commit 8466204

Browse files
committed
[GENERIC viewer] Add fallback logic for the old PDFPageView.update method signature
This is done separately from the previous commit, to make it easier to revert these changes in the future.
1 parent 7c81a8d commit 8466204

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

web/pdf_page_view.js

+17
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,23 @@ class PDFPageView {
298298
}
299299

300300
update({ scale = 0, rotation = null, optionalContentConfigPromise = null }) {
301+
if (
302+
typeof PDFJSDev !== "undefined" &&
303+
PDFJSDev.test("GENERIC") &&
304+
typeof arguments[0] !== "object"
305+
) {
306+
console.error(
307+
"PDFPageView.update called with separate parameters, please use an object instead."
308+
);
309+
310+
this.update({
311+
scale: arguments[0],
312+
rotation: arguments[1],
313+
optionalContentConfigPromise: arguments[2],
314+
});
315+
return;
316+
}
317+
301318
this.scale = scale || this.scale;
302319
if (typeof rotation === "number") {
303320
this.rotation = rotation; // The rotation may be zero.

0 commit comments

Comments
 (0)