Add deprecation warnings for the renderInteractiveForms and includeAnnotationStorage options, in PDFPageProxy.render

*This is done separately from the previous patch, to make it easier to revert these changes once they've been included in a couple of releases.*

Please note that because these two options are mutually exclusive, which is a large part of the reason for the previous patch, it's not guaranteed that the fallback-values will always be correct in every situation (but it's the best that we can do).
This commit is contained in:
Jonas Jenwald 2021-08-21 15:30:25 +02:00
parent 41efa3c071
commit 2a0ad8e696

View File

@ -1350,6 +1350,33 @@ class PDFPageProxy {
background = null, background = null,
optionalContentConfigPromise = null, optionalContentConfigPromise = null,
}) { }) {
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("GENERIC")) {
if (arguments[0]?.renderInteractiveForms !== undefined) {
deprecated(
"render no longer accepts the `renderInteractiveForms`-option, " +
"please use the `annotationMode`-option instead."
);
if (
arguments[0].renderInteractiveForms === true &&
annotationMode === AnnotationMode.ENABLE
) {
annotationMode = AnnotationMode.ENABLE_FORMS;
}
}
if (arguments[0]?.includeAnnotationStorage !== undefined) {
deprecated(
"render no longer accepts the `includeAnnotationStorage`-option, " +
"please use the `annotationMode`-option instead."
);
if (
arguments[0].includeAnnotationStorage === true &&
annotationMode === AnnotationMode.ENABLE
) {
annotationMode = AnnotationMode.ENABLE_STORAGE;
}
}
}
if (this._stats) { if (this._stats) {
this._stats.time("Overall"); this._stats.time("Overall");
} }