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:
Jonas Jenwald 2024-02-03 13:10:42 +01:00
parent 247af2ee09
commit 06cd278808
2 changed files with 13 additions and 26 deletions

View file

@ -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");