Do not cache content stream

This commit is contained in:
Mack Duan 2013-04-19 13:07:08 -07:00
parent 49ff029f5f
commit 30e127d848
3 changed files with 17 additions and 6 deletions

View File

@ -84,7 +84,7 @@ var Page = (function PageClosure() {
return obj; return obj;
}, },
get content() { get content() {
return shadow(this, 'content', this.getPageProp('Contents')); return this.getPageProp('Contents');
}, },
get resources() { get resources() {
return shadow(this, 'resources', this.inheritPageProp('Resources')); return shadow(this, 'resources', this.inheritPageProp('Resources'));
@ -131,6 +131,7 @@ var Page = (function PageClosure() {
}, },
getContentStream: function Page_getContentStream() { getContentStream: function Page_getContentStream() {
var content = this.content; var content = this.content;
var stream;
if (isArray(content)) { if (isArray(content)) {
// fetching items // fetching items
var xref = this.xref; var xref = this.xref;
@ -138,14 +139,14 @@ var Page = (function PageClosure() {
var streams = []; var streams = [];
for (i = 0; i < n; ++i) for (i = 0; i < n; ++i)
streams.push(xref.fetchIfRef(content[i])); streams.push(xref.fetchIfRef(content[i]));
content = new StreamsSequenceStream(streams); stream = new StreamsSequenceStream(streams);
} else if (isStream(content)) { } else if (isStream(content)) {
content.reset(); stream = content;
} else if (!content) { } else {
// replacing non-existent page content with empty one // replacing non-existent page content with empty one
content = new NullStream(); stream = new NullStream();
} }
return content; return stream;
}, },
getOperatorList: function Page_getOperatorList(handler) { getOperatorList: function Page_getOperatorList(handler) {
var self = this; var self = this;

View File

@ -0,0 +1 @@
http://mirrors.ctan.org/info/lshort/english/lshort.pdf

View File

@ -170,6 +170,15 @@
"rounds": 1, "rounds": 1,
"type": "eq" "type": "eq"
}, },
{
"id": "issue3115",
"file": "pdfs/issue3115.pdf",
"md5": "ea10f4131202b9b8f2a6cb7770d3f185",
"rounds": 1,
"type": "eq",
"link": true,
"lastPage": 1
},
{ "id": "thuluthfont-text", { "id": "thuluthfont-text",
"file": "pdfs/ThuluthFeatures.pdf", "file": "pdfs/ThuluthFeatures.pdf",
"md5": "b7e18bf7a3d6a9c82aefa12d721072fc", "md5": "b7e18bf7a3d6a9c82aefa12d721072fc",