From ee9b5a12da5470ffb8c1f79c39748c4aab75998b Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Mon, 2 Oct 2017 23:05:32 +0200 Subject: [PATCH] Remove the deprecated parameters for `getDocument` of the API This is deprecated since October 2015 with a visible message, so we can safely remove this now. --- src/display/api.js | 47 ++++++---------------------------------------- 1 file changed, 6 insertions(+), 41 deletions(-) diff --git a/src/display/api.js b/src/display/api.js index d2f8c4d1f..26b1793e5 100644 --- a/src/display/api.js +++ b/src/display/api.js @@ -15,11 +15,11 @@ /* globals requirejs, __non_webpack_require__ */ import { - AbortException, assert, createPromiseCapability, deprecated, - getVerbosityLevel, info, InvalidPDFException, isArrayBuffer, isSameOrigin, - loadJpegStream, MessageHandler, MissingPDFException, NativeImageDecoding, - PageViewport, PasswordException, StatTimer, stringToBytes, - UnexpectedResponseException, UnknownErrorException, Util, warn + AbortException, assert, createPromiseCapability, getVerbosityLevel, info, + InvalidPDFException, isArrayBuffer, isSameOrigin, loadJpegStream, + MessageHandler, MissingPDFException, NativeImageDecoding, PageViewport, + PasswordException, StatTimer, stringToBytes, UnexpectedResponseException, + UnknownErrorException, Util, warn } from '../shared/util'; import { DOMCanvasFactory, DOMCMapReaderFactory, getDefaultSetting, @@ -156,46 +156,11 @@ function setPDFNetworkStreamClass(cls) { * Can be a url to where a PDF is located, a typed array (Uint8Array) * already populated with data or parameter object. * - * @param {PDFDataRangeTransport} pdfDataRangeTransport (deprecated) It is used - * if you want to manually serve range requests for data in the PDF. - * - * @param {function} passwordCallback (deprecated) It is used to request a - * password if wrong or no password was provided. The callback receives two - * parameters: function that needs to be called with new password and reason - * (see {PasswordResponses}). - * - * @param {function} progressCallback (deprecated) It is used to be able to - * monitor the loading progress of the PDF file (necessary to implement e.g. - * a loading bar). The callback receives an {Object} with the properties: - * {number} loaded and {number} total. - * * @return {PDFDocumentLoadingTask} */ -function getDocument(src, pdfDataRangeTransport, - passwordCallback, progressCallback) { +function getDocument(src) { var task = new PDFDocumentLoadingTask(); - // Support of the obsolete arguments (for compatibility with API v1.0) - if (arguments.length > 1) { - deprecated('getDocument is called with pdfDataRangeTransport, ' + - 'passwordCallback or progressCallback argument'); - } - if (pdfDataRangeTransport) { - if (!(pdfDataRangeTransport instanceof PDFDataRangeTransport)) { - // Not a PDFDataRangeTransport instance, trying to add missing properties. - pdfDataRangeTransport = Object.create(pdfDataRangeTransport); - pdfDataRangeTransport.length = src.length; - pdfDataRangeTransport.initialData = src.initialData; - if (!pdfDataRangeTransport.abort) { - pdfDataRangeTransport.abort = function () {}; - } - } - src = Object.create(src); - src.range = pdfDataRangeTransport; - } - task.onPassword = passwordCallback || null; - task.onProgress = progressCallback || null; - var source; if (typeof src === 'string') { source = { url: src, };