mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #15943 from Snuffleupagus/deprecate-direct-PDFDataRangeTransport
[api-minor] Deprecate calling `getDocument` directly with a `PDFDataRangeTransport`-instance
This commit is contained in:
commit
a27d7ba524
2 changed files with 11 additions and 5 deletions
|
@ -233,8 +233,7 @@ if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("PRODUCTION")) {
|
|||
*/
|
||||
|
||||
/**
|
||||
* @typedef { string | URL | TypedArray | ArrayBuffer |
|
||||
* PDFDataRangeTransport | DocumentInitParameters
|
||||
* @typedef { string | URL | TypedArray | ArrayBuffer | DocumentInitParameters
|
||||
* } GetDocumentParameters
|
||||
*/
|
||||
|
||||
|
@ -258,7 +257,14 @@ function getDocument(src) {
|
|||
source = { url: src };
|
||||
} else if (isArrayBuffer(src)) {
|
||||
source = { data: src };
|
||||
} else if (src instanceof PDFDataRangeTransport) {
|
||||
} else if (
|
||||
(typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) &&
|
||||
src instanceof PDFDataRangeTransport
|
||||
) {
|
||||
deprecated(
|
||||
"`PDFDataRangeTransport`-instance, " +
|
||||
"please use a parameter object with `range`-property instead."
|
||||
);
|
||||
source = { range: src };
|
||||
} else {
|
||||
if (typeof src !== "object") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue