1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 22:58:07 +02:00

Merge pull request #16774 from Snuffleupagus/rm-deprecated-options

[api-major] Remove various deprecated functionality and options
This commit is contained in:
Jonas Jenwald 2023-10-03 15:12:39 +02:00 committed by GitHub
commit 0edc490e1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 1 additions and 91 deletions

View file

@ -1040,22 +1040,6 @@ const PDFViewerApplication = {
* @returns {Promise} - Promise that is resolved when the document is opened.
*/
async open(args) {
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
let deprecatedArgs = false;
if (typeof args === "string") {
args = { url: args }; // URL
deprecatedArgs = true;
} else if (args?.byteLength) {
args = { data: args }; // ArrayBuffer
deprecatedArgs = true;
}
if (deprecatedArgs) {
console.error(
"The `PDFViewerApplication.open` signature was updated, please use an object instead."
);
}
}
if (this.pdfLoadingTask) {
// We need to destroy already opened document.
await this.close();

View file

@ -448,18 +448,6 @@ class PDFFindController {
if (!state) {
return;
}
if (
(typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) &&
state.phraseSearch === false
) {
console.error(
"The `phraseSearch`-parameter was removed, please provide " +
"an Array of strings in the `query`-parameter instead."
);
if (typeof state.query === "string") {
state.query = state.query.match(/\S+/g);
}
}
const pdfDocument = this._pdfDocument;
const { type } = state;

View file

@ -167,13 +167,6 @@ class PDFPageView {
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
this._isStandalone = !this.renderingQueue?.hasViewer();
this._container = container;
if (options.useOnlyCssZoom) {
console.error(
"useOnlyCssZoom was removed, please use `maxCanvasPixels = 0` instead."
);
this.maxCanvasPixels = 0;
}
}
this._annotationCanvasMap = null;

View file

@ -280,13 +280,6 @@ class PDFViewer {
this.enablePrintAutoRotate = options.enablePrintAutoRotate || false;
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
this.removePageBorders = options.removePageBorders || false;
if (options.useOnlyCssZoom) {
console.error(
"useOnlyCssZoom was removed, please use `maxCanvasPixels = 0` instead."
);
options.maxCanvasPixels = 0;
}
}
this.isOffscreenCanvasSupported =
options.isOffscreenCanvasSupported ?? true;