mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
Simplify the signature of the PDFDataTransportStream
constructor
Given that we need to pass in a `PDFDataRangeTransport`-instance a number of the needed parameters can be obtained from it, rather than having to specify them manually.
This commit is contained in:
parent
247af2ee09
commit
06cd278808
2 changed files with 13 additions and 26 deletions
|
@ -405,18 +405,10 @@ function getDocument(src) {
|
|||
const networkStreamPromise = new Promise(function (resolve) {
|
||||
let networkStream;
|
||||
if (rangeTransport) {
|
||||
networkStream = new PDFDataTransportStream(
|
||||
{
|
||||
length,
|
||||
initialData: rangeTransport.initialData,
|
||||
progressiveDone: rangeTransport.progressiveDone,
|
||||
contentDispositionFilename:
|
||||
rangeTransport.contentDispositionFilename,
|
||||
disableRange,
|
||||
disableStream,
|
||||
},
|
||||
rangeTransport
|
||||
);
|
||||
networkStream = new PDFDataTransportStream(rangeTransport, {
|
||||
disableRange,
|
||||
disableStream,
|
||||
});
|
||||
} else if (!data) {
|
||||
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) {
|
||||
throw new Error("Not implemented: createPDFNetworkStream");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue