Merge remote branch 'upstream/master'
This commit is contained in:
commit
a0c70b7162
99
pdf.js
99
pdf.js
@ -2021,6 +2021,25 @@ var CCITTFaxStream = (function ccittFaxStream() {
|
|||||||
return EOF;
|
return EOF;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var findTableCode = function ccittFaxStreamFindTableCode(start, end, table,
|
||||||
|
limit) {
|
||||||
|
for (var i = start; i <= end; ++i) {
|
||||||
|
var code = this.lookBits(i);
|
||||||
|
if (code == EOF)
|
||||||
|
return [true, 1];
|
||||||
|
if (i < end)
|
||||||
|
code <<= end - i;
|
||||||
|
if (code >= limit) {
|
||||||
|
var p = table[code - ((limit == ccittEOL) ? 0 : limit)];
|
||||||
|
if (p[0] == i) {
|
||||||
|
this.eatBits(i);
|
||||||
|
return [true, p[1]];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return [false, 0];
|
||||||
|
};
|
||||||
|
|
||||||
constructor.prototype.getWhiteCode = function ccittFaxStreamGetWhiteCode() {
|
constructor.prototype.getWhiteCode = function ccittFaxStreamGetWhiteCode() {
|
||||||
var code = 0;
|
var code = 0;
|
||||||
var p;
|
var p;
|
||||||
@ -2040,31 +2059,13 @@ var CCITTFaxStream = (function ccittFaxStream() {
|
|||||||
return p[1];
|
return p[1];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (var n = 1; n <= 9; ++n) {
|
var result = findTableCode(1, 9, whiteTable2, ccittEOL);
|
||||||
code = this.lookBits(n);
|
if (result[0])
|
||||||
if (code == EOF)
|
return result[1];
|
||||||
return 1;
|
|
||||||
|
|
||||||
if (n < 9)
|
result = findTableCode(11, 12, whiteTable1, ccittEOL);
|
||||||
code <<= 9 - n;
|
if (result[0])
|
||||||
p = whiteTable2[code];
|
return result[1];
|
||||||
if (p[0] == n) {
|
|
||||||
this.eatBits(n);
|
|
||||||
return p[0];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (var n = 11; n <= 12; ++n) {
|
|
||||||
code = this.lookBits(n);
|
|
||||||
if (code == EOF)
|
|
||||||
return 1;
|
|
||||||
if (n < 12)
|
|
||||||
code <<= 12 - n;
|
|
||||||
p = whiteTable1[code];
|
|
||||||
if (p[0] == n) {
|
|
||||||
this.eatBits(n);
|
|
||||||
return p[1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
warn('bad white code');
|
warn('bad white code');
|
||||||
this.eatBits(1);
|
this.eatBits(1);
|
||||||
@ -2089,45 +2090,17 @@ var CCITTFaxStream = (function ccittFaxStream() {
|
|||||||
return p[1];
|
return p[1];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var n;
|
var result = findTableCode(2, 6, blackTable3, ccittEOL);
|
||||||
for (n = 2; n <= 6; ++n) {
|
if (result[0])
|
||||||
code = this.lookBits(n);
|
return result[1];
|
||||||
if (code == EOF)
|
|
||||||
return 1;
|
result = findTableCode(7, 12, blackTable2, 64);
|
||||||
if (n < 6)
|
if (result[0])
|
||||||
code <<= 6 - n;
|
return result[1];
|
||||||
p = blackTable3[code];
|
|
||||||
if (p[0] == n) {
|
result = findTableCode(10, 13, blackTable1, ccittEOL);
|
||||||
this.eatBits(n);
|
if (result[0])
|
||||||
return p[1];
|
return result[1];
|
||||||
}
|
|
||||||
}
|
|
||||||
for (n = 7; n <= 12; ++n) {
|
|
||||||
code = this.lookBits(n);
|
|
||||||
if (code == EOF)
|
|
||||||
return 1;
|
|
||||||
if (n < 12)
|
|
||||||
code <<= 12 - n;
|
|
||||||
if (code >= 64) {
|
|
||||||
p = blackTable2[code - 64];
|
|
||||||
if (p[0] == n) {
|
|
||||||
this.eatBits(n);
|
|
||||||
return p[1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (n = 10; n <= 13; ++n) {
|
|
||||||
code = this.lookBits(n);
|
|
||||||
if (code == EOF)
|
|
||||||
return 1;
|
|
||||||
if (n < 13)
|
|
||||||
code <<= 13 - n;
|
|
||||||
p = blackTable1[code];
|
|
||||||
if (p[0] == n) {
|
|
||||||
this.eatBits(n);
|
|
||||||
return p[1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
warn('bad black code');
|
warn('bad black code');
|
||||||
this.eatBits(1);
|
this.eatBits(1);
|
||||||
|
@ -17,12 +17,12 @@
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div id="controls">
|
<div id="controls">
|
||||||
<button id="previous" onclick="PDFView.page--;">
|
<button id="previous" onclick="PDFView.page--;" oncontextmenu="return false;">
|
||||||
<img src="images/go-up.svg" align="top" height="32"/>
|
<img src="images/go-up.svg" align="top" height="32"/>
|
||||||
Previous
|
Previous
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button id="next" onclick="PDFView.page++;">
|
<button id="next" onclick="PDFView.page++;" oncontextmenu="return false;">
|
||||||
<img src="images/go-down.svg" align="top" height="32"/>
|
<img src="images/go-down.svg" align="top" height="32"/>
|
||||||
Next
|
Next
|
||||||
</button>
|
</button>
|
||||||
@ -36,16 +36,16 @@
|
|||||||
|
|
||||||
<div class="separator"></div>
|
<div class="separator"></div>
|
||||||
|
|
||||||
<button id="next" title="Zoom Out" onclick="PDFView.zoomOut();">
|
<button id="zoomOut" title="Zoom Out" onclick="PDFView.zoomOut();" oncontextmenu="return false;">
|
||||||
<img src="images/zoom-out.svg" align="top" height="32"/>
|
<img src="images/zoom-out.svg" align="top" height="32"/>
|
||||||
</button>
|
</button>
|
||||||
<button id="next" title="Zoom In" onclick="PDFView.zoomIn();">
|
<button id="zoomIn" title="Zoom In" onclick="PDFView.zoomIn();" oncontextmenu="return false;">
|
||||||
<img src="images/zoom-in.svg" align="top" height="32"/>
|
<img src="images/zoom-in.svg" align="top" height="32"/>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div class="separator"></div>
|
<div class="separator"></div>
|
||||||
|
|
||||||
<select id="scaleSelect" onchange="PDFView.parseScale(this.value);">
|
<select id="scaleSelect" onchange="PDFView.parseScale(this.value);" oncontextmenu="return false;">
|
||||||
<option id="customScaleOption" value="custom"></option>
|
<option id="customScaleOption" value="custom"></option>
|
||||||
<option value="0.5">50%</option>
|
<option value="0.5">50%</option>
|
||||||
<option value="0.75">75%</option>
|
<option value="0.75">75%</option>
|
||||||
@ -59,14 +59,14 @@
|
|||||||
|
|
||||||
<div class="separator"></div>
|
<div class="separator"></div>
|
||||||
|
|
||||||
<button id="print" onclick="window.print();">
|
<button id="print" onclick="window.print();" oncontextmenu="return false;">
|
||||||
<img src="images/document-print.svg" align="top" height="32"/>
|
<img src="images/document-print.svg" align="top" height="32"/>
|
||||||
Print
|
Print
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div class="separator"></div>
|
<div class="separator"></div>
|
||||||
|
|
||||||
<input id="fileInput" type="file"/>
|
<input id="fileInput" type="file" oncontextmenu="return false;"/>
|
||||||
|
|
||||||
<div class="separator"></div>
|
<div class="separator"></div>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user