mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Do not cache content stream
This commit is contained in:
parent
49ff029f5f
commit
30e127d848
3 changed files with 17 additions and 6 deletions
13
src/core.js
13
src/core.js
|
@ -84,7 +84,7 @@ var Page = (function PageClosure() {
|
|||
return obj;
|
||||
},
|
||||
get content() {
|
||||
return shadow(this, 'content', this.getPageProp('Contents'));
|
||||
return this.getPageProp('Contents');
|
||||
},
|
||||
get resources() {
|
||||
return shadow(this, 'resources', this.inheritPageProp('Resources'));
|
||||
|
@ -131,6 +131,7 @@ var Page = (function PageClosure() {
|
|||
},
|
||||
getContentStream: function Page_getContentStream() {
|
||||
var content = this.content;
|
||||
var stream;
|
||||
if (isArray(content)) {
|
||||
// fetching items
|
||||
var xref = this.xref;
|
||||
|
@ -138,14 +139,14 @@ var Page = (function PageClosure() {
|
|||
var streams = [];
|
||||
for (i = 0; i < n; ++i)
|
||||
streams.push(xref.fetchIfRef(content[i]));
|
||||
content = new StreamsSequenceStream(streams);
|
||||
stream = new StreamsSequenceStream(streams);
|
||||
} else if (isStream(content)) {
|
||||
content.reset();
|
||||
} else if (!content) {
|
||||
stream = content;
|
||||
} else {
|
||||
// replacing non-existent page content with empty one
|
||||
content = new NullStream();
|
||||
stream = new NullStream();
|
||||
}
|
||||
return content;
|
||||
return stream;
|
||||
},
|
||||
getOperatorList: function Page_getOperatorList(handler) {
|
||||
var self = this;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue