Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/core/decode_stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,19 @@ class DecodeStream extends BaseStream {
getBaseStreams() {
return this.stream ? this.stream.getBaseStreams() : null;
}

clone() {
// Make sure it has been fully read.
while (!this.eof) {
this.readBlock();
}
return new Stream(
this.buffer,
this.start,
this.end - this.start,
this.dict.clone()
);
}
}

class StreamsSequenceStream extends DecodeStream {
Expand Down
4 changes: 4 additions & 0 deletions src/core/decrypt_stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ class DecryptStream extends DecodeStream {
buffer.set(chunk, bufferLength);
this.bufferLength = newLength;
}

getOriginalStream() {
return this;
}
}

export { DecryptStream };
6 changes: 3 additions & 3 deletions src/core/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class Page {
);
}

#getBoundingBox(name) {
getBoundingBox(name) {
if (this.xfaData) {
return this.xfaData.bbox;
}
Expand All @@ -201,7 +201,7 @@ class Page {
return shadow(
this,
"mediaBox",
this.#getBoundingBox("MediaBox") || LETTER_SIZE_MEDIABOX
this.getBoundingBox("MediaBox") || LETTER_SIZE_MEDIABOX
);
}

Expand All @@ -210,7 +210,7 @@ class Page {
return shadow(
this,
"cropBox",
this.#getBoundingBox("CropBox") || this.mediaBox
this.getBoundingBox("CropBox") || this.mediaBox
);
}

Expand Down
Loading