|
|
|
@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
@@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
|
|
|
|
|
(typeof window !== 'undefined' ? window : this).PDFJS = {}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
PDFJS.version = '1.0.566'; |
|
|
|
|
PDFJS.build = 'cb59b57'; |
|
|
|
|
PDFJS.version = '1.0.569'; |
|
|
|
|
PDFJS.build = '10daf04'; |
|
|
|
|
|
|
|
|
|
(function pdfjsWrapper() { |
|
|
|
|
// Use strict in our context only - users might not want it
|
|
|
|
@ -33547,7 +33547,7 @@ var Parser = (function ParserClosure() {
@@ -33547,7 +33547,7 @@ var Parser = (function ParserClosure() {
|
|
|
|
|
|
|
|
|
|
// searching for the /EI\s/
|
|
|
|
|
var state = 0, ch, i, ii; |
|
|
|
|
while (state != 4 && (ch = stream.getByte()) !== -1) { |
|
|
|
|
while (state !== 4 && (ch = stream.getByte()) !== -1) { |
|
|
|
|
switch (ch | 0) { |
|
|
|
|
case 0x20: |
|
|
|
|
case 0x0D: |
|
|
|
@ -33741,7 +33741,7 @@ var Parser = (function ParserClosure() {
@@ -33741,7 +33741,7 @@ var Parser = (function ParserClosure() {
|
|
|
|
|
} |
|
|
|
|
try { |
|
|
|
|
var xrefStreamStats = this.xref.stats.streamTypes; |
|
|
|
|
if (name == 'FlateDecode' || name == 'Fl') { |
|
|
|
|
if (name === 'FlateDecode' || name === 'Fl') { |
|
|
|
|
xrefStreamStats[StreamType.FLATE] = true; |
|
|
|
|
if (params) { |
|
|
|
|
return new PredictorStream(new FlateStream(stream, maybeLength), |
|
|
|
@ -33749,7 +33749,7 @@ var Parser = (function ParserClosure() {
@@ -33749,7 +33749,7 @@ var Parser = (function ParserClosure() {
|
|
|
|
|
} |
|
|
|
|
return new FlateStream(stream, maybeLength); |
|
|
|
|
} |
|
|
|
|
if (name == 'LZWDecode' || name == 'LZW') { |
|
|
|
|
if (name === 'LZWDecode' || name === 'LZW') { |
|
|
|
|
xrefStreamStats[StreamType.LZW] = true; |
|
|
|
|
var earlyChange = 1; |
|
|
|
|
if (params) { |
|
|
|
@ -33762,31 +33762,31 @@ var Parser = (function ParserClosure() {
@@ -33762,31 +33762,31 @@ var Parser = (function ParserClosure() {
|
|
|
|
|
} |
|
|
|
|
return new LZWStream(stream, maybeLength, earlyChange); |
|
|
|
|
} |
|
|
|
|
if (name == 'DCTDecode' || name == 'DCT') { |
|
|
|
|
if (name === 'DCTDecode' || name === 'DCT') { |
|
|
|
|
xrefStreamStats[StreamType.DCT] = true; |
|
|
|
|
return new JpegStream(stream, maybeLength, stream.dict, this.xref); |
|
|
|
|
} |
|
|
|
|
if (name == 'JPXDecode' || name == 'JPX') { |
|
|
|
|
if (name === 'JPXDecode' || name === 'JPX') { |
|
|
|
|
xrefStreamStats[StreamType.JPX] = true; |
|
|
|
|
return new JpxStream(stream, maybeLength, stream.dict); |
|
|
|
|
} |
|
|
|
|
if (name == 'ASCII85Decode' || name == 'A85') { |
|
|
|
|
if (name === 'ASCII85Decode' || name === 'A85') { |
|
|
|
|
xrefStreamStats[StreamType.A85] = true; |
|
|
|
|
return new Ascii85Stream(stream, maybeLength); |
|
|
|
|
} |
|
|
|
|
if (name == 'ASCIIHexDecode' || name == 'AHx') { |
|
|
|
|
if (name === 'ASCIIHexDecode' || name === 'AHx') { |
|
|
|
|
xrefStreamStats[StreamType.AHX] = true; |
|
|
|
|
return new AsciiHexStream(stream, maybeLength); |
|
|
|
|
} |
|
|
|
|
if (name == 'CCITTFaxDecode' || name == 'CCF') { |
|
|
|
|
if (name === 'CCITTFaxDecode' || name === 'CCF') { |
|
|
|
|
xrefStreamStats[StreamType.CCF] = true; |
|
|
|
|
return new CCITTFaxStream(stream, maybeLength, params); |
|
|
|
|
} |
|
|
|
|
if (name == 'RunLengthDecode' || name == 'RL') { |
|
|
|
|
if (name === 'RunLengthDecode' || name === 'RL') { |
|
|
|
|
xrefStreamStats[StreamType.RL] = true; |
|
|
|
|
return new RunLengthStream(stream, maybeLength); |
|
|
|
|
} |
|
|
|
|
if (name == 'JBIG2Decode') { |
|
|
|
|
if (name === 'JBIG2Decode') { |
|
|
|
|
xrefStreamStats[StreamType.JBIG] = true; |
|
|
|
|
return new Jbig2Stream(stream, maybeLength, stream.dict); |
|
|
|
|
} |
|
|
|
@ -34045,7 +34045,7 @@ var Lexer = (function LexerClosure() {
@@ -34045,7 +34045,7 @@ var Lexer = (function LexerClosure() {
|
|
|
|
|
if (ch === 0x23) { // '#'
|
|
|
|
|
ch = this.nextChar(); |
|
|
|
|
var x = toHexDigit(ch); |
|
|
|
|
if (x != -1) { |
|
|
|
|
if (x !== -1) { |
|
|
|
|
var x2 = toHexDigit(this.nextChar()); |
|
|
|
|
if (x2 === -1) { |
|
|
|
|
error('Illegal digit in hex char in name: ' + x2); |
|
|
|
@ -34827,10 +34827,10 @@ var FlateStream = (function FlateStreamClosure() {
@@ -34827,10 +34827,10 @@ var FlateStream = (function FlateStreamClosure() {
|
|
|
|
|
|
|
|
|
|
var cmf = str.getByte(); |
|
|
|
|
var flg = str.getByte(); |
|
|
|
|
if (cmf == -1 || flg == -1) { |
|
|
|
|
if (cmf === -1 || flg === -1) { |
|
|
|
|
error('Invalid header in flate stream: ' + cmf + ', ' + flg); |
|
|
|
|
} |
|
|
|
|
if ((cmf & 0x0f) != 0x08) { |
|
|
|
|
if ((cmf & 0x0f) !== 0x08) { |
|
|
|
|
error('Unknown compression method in flate stream: ' + cmf + ', ' + flg); |
|
|
|
|
} |
|
|
|
|
if ((((cmf << 8) + flg) % 31) !== 0) { |
|
|
|
@ -34916,7 +34916,7 @@ var FlateStream = (function FlateStreamClosure() {
@@ -34916,7 +34916,7 @@ var FlateStream = (function FlateStreamClosure() {
|
|
|
|
|
len <= maxLen; |
|
|
|
|
++len, code <<= 1, skip <<= 1) { |
|
|
|
|
for (var val = 0; val < n; ++val) { |
|
|
|
|
if (lengths[val] == len) { |
|
|
|
|
if (lengths[val] === len) { |
|
|
|
|
// bit-reverse the code
|
|
|
|
|
var code2 = 0; |
|
|
|
|
var t = code; |
|
|
|
@ -34966,7 +34966,7 @@ var FlateStream = (function FlateStreamClosure() {
@@ -34966,7 +34966,7 @@ var FlateStream = (function FlateStreamClosure() {
|
|
|
|
|
error('Bad block header in flate stream'); |
|
|
|
|
} |
|
|
|
|
check |= (b << 8); |
|
|
|
|
if (check != (~blockLen & 0xffff) && |
|
|
|
|
if (check !== (~blockLen & 0xffff) && |
|
|
|
|
(blockLen !== 0 || check !== 0)) { |
|
|
|
|
// Ignoring error for bad "empty" block (see issue 1277)
|
|
|
|
|
error('Bad uncompressed block length in flate stream'); |
|
|
|
@ -34997,10 +34997,10 @@ var FlateStream = (function FlateStreamClosure() {
@@ -34997,10 +34997,10 @@ var FlateStream = (function FlateStreamClosure() {
|
|
|
|
|
|
|
|
|
|
var litCodeTable; |
|
|
|
|
var distCodeTable; |
|
|
|
|
if (hdr == 1) { // compressed block, fixed codes
|
|
|
|
|
if (hdr === 1) { // compressed block, fixed codes
|
|
|
|
|
litCodeTable = fixedLitCodeTab; |
|
|
|
|
distCodeTable = fixedDistCodeTab; |
|
|
|
|
} else if (hdr == 2) { // compressed block, dynamic codes
|
|
|
|
|
} else if (hdr === 2) { // compressed block, dynamic codes
|
|
|
|
|
var numLitCodes = this.getBits(5) + 257; |
|
|
|
|
var numDistCodes = this.getBits(5) + 1; |
|
|
|
|
var numCodeLenCodes = this.getBits(4) + 4; |
|
|
|
@ -35022,11 +35022,11 @@ var FlateStream = (function FlateStreamClosure() {
@@ -35022,11 +35022,11 @@ var FlateStream = (function FlateStreamClosure() {
|
|
|
|
|
var bitsLength, bitsOffset, what; |
|
|
|
|
while (i < codes) { |
|
|
|
|
var code = this.getCode(codeLenCodeTab); |
|
|
|
|
if (code == 16) { |
|
|
|
|
if (code === 16) { |
|
|
|
|
bitsLength = 2; bitsOffset = 3; what = len; |
|
|
|
|
} else if (code == 17) { |
|
|
|
|
} else if (code === 17) { |
|
|
|
|
bitsLength = 3; bitsOffset = 3; what = (len = 0); |
|
|
|
|
} else if (code == 18) { |
|
|
|
|
} else if (code === 18) { |
|
|
|
|
bitsLength = 7; bitsOffset = 11; what = (len = 0); |
|
|
|
|
} else { |
|
|
|
|
codeLengths[i++] = len = code; |
|
|
|
@ -35060,7 +35060,7 @@ var FlateStream = (function FlateStreamClosure() {
@@ -35060,7 +35060,7 @@ var FlateStream = (function FlateStreamClosure() {
|
|
|
|
|
buffer[pos++] = code1; |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
if (code1 == 256) { |
|
|
|
|
if (code1 === 256) { |
|
|
|
|
this.bufferLength = pos; |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
@ -35381,7 +35381,7 @@ var JpegStream = (function JpegStreamClosure() {
@@ -35381,7 +35381,7 @@ var JpegStream = (function JpegStreamClosure() {
|
|
|
|
|
function JpegStream_isNativelyDecodable(xref, res) { |
|
|
|
|
var cs = ColorSpace.parse(this.dict.get('ColorSpace', 'CS'), xref, res); |
|
|
|
|
var numComps = cs.numComps; |
|
|
|
|
return numComps == 1 || numComps == 3; |
|
|
|
|
return numComps === 1 || numComps === 3; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
return JpegStream; |
|
|
|
@ -35601,7 +35601,7 @@ var Ascii85Stream = (function Ascii85StreamClosure() {
@@ -35601,7 +35601,7 @@ var Ascii85Stream = (function Ascii85StreamClosure() {
|
|
|
|
|
var i; |
|
|
|
|
|
|
|
|
|
// special code for z
|
|
|
|
|
if (c == Z_LOWER_CHAR) { |
|
|
|
|
if (c === Z_LOWER_CHAR) { |
|
|
|
|
buffer = this.ensureBuffer(bufferLength + 4); |
|
|
|
|
for (i = 0; i < 4; ++i) { |
|
|
|
|
buffer[bufferLength + i] = 0; |
|
|
|
@ -35618,7 +35618,7 @@ var Ascii85Stream = (function Ascii85StreamClosure() {
@@ -35618,7 +35618,7 @@ var Ascii85Stream = (function Ascii85StreamClosure() {
|
|
|
|
|
|
|
|
|
|
input[i] = c; |
|
|
|
|
|
|
|
|
|
if (c === EOF || c == TILDA_CHAR) { |
|
|
|
|
if (c === EOF || c === TILDA_CHAR) { |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -35725,7 +35725,7 @@ var RunLengthStream = (function RunLengthStreamClosure() {
@@ -35725,7 +35725,7 @@ var RunLengthStream = (function RunLengthStreamClosure() {
|
|
|
|
|
// (in addition to the second byte from the header), n = 129 through 255 -
|
|
|
|
|
// duplicate the second byte from the header (257 - n) times, n = 128 - end.
|
|
|
|
|
var repeatHeader = this.str.getBytes(2); |
|
|
|
|
if (!repeatHeader || repeatHeader.length < 2 || repeatHeader[0] == 128) { |
|
|
|
|
if (!repeatHeader || repeatHeader.length < 2 || repeatHeader[0] === 128) { |
|
|
|
|
this.eof = true; |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
@ -36218,7 +36218,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() {
@@ -36218,7 +36218,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() {
|
|
|
|
|
while ((code1 = this.lookBits(12)) === 0) { |
|
|
|
|
this.eatBits(1); |
|
|
|
|
} |
|
|
|
|
if (code1 == 1) { |
|
|
|
|
if (code1 === 1) { |
|
|
|
|
this.eatBits(12); |
|
|
|
|
} |
|
|
|
|
if (this.encoding > 0) { |
|
|
|
@ -36477,7 +36477,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() {
@@ -36477,7 +36477,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() {
|
|
|
|
|
|
|
|
|
|
var gotEOL = false; |
|
|
|
|
|
|
|
|
|
if (!this.eoblock && this.row == this.rows - 1) { |
|
|
|
|
if (!this.eoblock && this.row === this.rows - 1) { |
|
|
|
|
this.eof = true; |
|
|
|
|
} else { |
|
|
|
|
code1 = this.lookBits(12); |
|
|
|
@ -36485,10 +36485,10 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() {
@@ -36485,10 +36485,10 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() {
|
|
|
|
|
this.eatBits(1); |
|
|
|
|
code1 = this.lookBits(12); |
|
|
|
|
} |
|
|
|
|
if (code1 == 1) { |
|
|
|
|
if (code1 === 1) { |
|
|
|
|
this.eatBits(12); |
|
|
|
|
gotEOL = true; |
|
|
|
|
} else if (code1 == EOF) { |
|
|
|
|
} else if (code1 === EOF) { |
|
|
|
|
this.eof = true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -36500,7 +36500,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() {
@@ -36500,7 +36500,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() {
|
|
|
|
|
|
|
|
|
|
if (this.eoblock && gotEOL) { |
|
|
|
|
code1 = this.lookBits(12); |
|
|
|
|
if (code1 == 1) { |
|
|
|
|
if (code1 === 1) { |
|
|
|
|
this.eatBits(12); |
|
|
|
|
if (this.encoding > 0) { |
|
|
|
|
this.lookBits(1); |
|
|
|
@ -36509,7 +36509,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() {
@@ -36509,7 +36509,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() {
|
|
|
|
|
if (this.encoding >= 0) { |
|
|
|
|
for (i = 0; i < 4; ++i) { |
|
|
|
|
code1 = this.lookBits(12); |
|
|
|
|
if (code1 != 1) { |
|
|
|
|
if (code1 !== 1) { |
|
|
|
|
info('bad rtc code: ' + code1); |
|
|
|
|
} |
|
|
|
|
this.eatBits(12); |
|
|
|
@ -36524,11 +36524,11 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() {
@@ -36524,11 +36524,11 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() {
|
|
|
|
|
} else if (this.err && this.eoline) { |
|
|
|
|
while (true) { |
|
|
|
|
code1 = this.lookBits(13); |
|
|
|
|
if (code1 == EOF) { |
|
|
|
|
if (code1 === EOF) { |
|
|
|
|
this.eof = true; |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
if ((code1 >> 1) == 1) { |
|
|
|
|
if ((code1 >> 1) === 1) { |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
this.eatBits(1); |
|
|
|
@ -36604,7 +36604,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() {
@@ -36604,7 +36604,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() {
|
|
|
|
|
var limitValue = limit || 0; |
|
|
|
|
for (var i = start; i <= end; ++i) { |
|
|
|
|
var code = this.lookBits(i); |
|
|
|
|
if (code == EOF) { |
|
|
|
|
if (code === EOF) { |
|
|
|
|
return [true, 1, false]; |
|
|
|
|
} |
|
|
|
|
if (i < end) { |
|
|
|
@ -36612,7 +36612,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() {
@@ -36612,7 +36612,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() {
|
|
|
|
|
} |
|
|
|
|
if (!limitValue || code >= limitValue) { |
|
|
|
|
var p = table[code - limitValue]; |
|
|
|
|
if (p[0] == i) { |
|
|
|
|
if (p[0] === i) { |
|
|
|
|
this.eatBits(i); |
|
|
|
|
return [true, p[1], true]; |
|
|
|
|
} |
|
|
|
@ -36650,7 +36650,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() {
@@ -36650,7 +36650,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() {
|
|
|
|
|
var p; |
|
|
|
|
if (this.eoblock) { |
|
|
|
|
code = this.lookBits(12); |
|
|
|
|
if (code == EOF) { |
|
|
|
|
if (code === EOF) { |
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -36686,7 +36686,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() {
@@ -36686,7 +36686,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() {
|
|
|
|
|
var code, p; |
|
|
|
|
if (this.eoblock) { |
|
|
|
|
code = this.lookBits(13); |
|
|
|
|
if (code == EOF) { |
|
|
|
|
if (code === EOF) { |
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
if ((code >> 7) === 0) { |
|
|
|
@ -36834,7 +36834,7 @@ var LZWStream = (function LZWStreamClosure() {
@@ -36834,7 +36834,7 @@ var LZWStream = (function LZWStreamClosure() {
|
|
|
|
|
} else { |
|
|
|
|
currentSequence[currentSequenceLength++] = currentSequence[0]; |
|
|
|
|
} |
|
|
|
|
} else if (code == 256) { |
|
|
|
|
} else if (code === 256) { |
|
|
|
|
codeLength = 9; |
|
|
|
|
nextCode = 258; |
|
|
|
|
currentSequenceLength = 0; |
|
|
|
|