Merge pull request #519 from notmasteryet/default-mediabox

Reset invalid media box to letter size.
This commit is contained in:
Chris Jones 2011-09-23 17:33:27 -07:00
commit d2a00a4c7b

6
pdf.js
View File

@ -3321,8 +3321,10 @@ var Page = (function pagePage() {
}, },
get mediaBox() { get mediaBox() {
var obj = this.inheritPageProp('MediaBox'); var obj = this.inheritPageProp('MediaBox');
return shadow(this, 'mediaBox', // Reset invalid media box to letter size.
((IsArray(obj) && obj.length == 4) ? obj : null)); if (!IsArray(obj) || obj.length === 4)
obj = [0, 0, 612, 792];
return shadow(this, 'mediaBox', obj);
}, },
get view() { get view() {
var obj = this.inheritPageProp('CropBox'); var obj = this.inheritPageProp('CropBox');