Skip to content

Commit

Permalink
Add deprecated handling of the now removed AnnotationStorage API-…
Browse files Browse the repository at this point in the history
…parameters

These changes are done separately, to make it easier to remove them in the future.
  • Loading branch information
Snuffleupagus committed Apr 9, 2021
1 parent 72ef183 commit 737a8e8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/display/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,12 @@ class PDFDocumentProxy {
* {Uint8Array} containing the full data of the saved document.
*/
saveDocument() {
if (
(typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) &&
arguments.length > 0
) {
deprecated("saveDocument no longer accepts any options.");
}
if (
(typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) &&
this._transport.annotationStorage.size <= 0
Expand Down Expand Up @@ -1241,6 +1247,16 @@ class PDFPageProxy {
includeAnnotationStorage = false,
optionalContentConfigPromise = null,
}) {
if (
(typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) &&
arguments[0]?.annotationStorage !== undefined
) {
deprecated(
"render no longer accepts an `annotationStorage` option, " +
"please use the `includeAnnotationStorage`-boolean instead."
);
includeAnnotationStorage ||= !!arguments[0].annotationStorage;
}
if (this._stats) {
this._stats.time("Overall");
}
Expand Down

0 comments on commit 737a8e8

Please sign in to comment.