andreasgal/pdf.js — Issue #664: artofwar.pdf generates errors that are not visible in the test result
Author: kkujala
Created: 2011-10-14 22:09:50+00:00
State: open

loading page 4/160... error("Unknown compression method in flate stream: 217, 154")@http://localhost:8080/pdf.js:32
constructor([object Object])@http://localhost:8080/pdf.js:491
parserMakeFilter([object Object],"FlateDecode",235,(void 0))@http://localhost:8080/pdf.js:2970
parserFilter([object Object],[object Object],235)@http://localhost:8080/pdf.js:2945
parserMakeStream([object Object],[object Object])@http://localhost:8080/pdf.js:2937
parserGetObj([object Object])@http://localhost:8080/pdf.js:2816
xRefFetch([object Object])@http://localhost:8080/pdf.js:3398
partialEvaluatorExtractEncoding([object Object],[object Object],[object Object])@http://localhost:8080/pdf.js:4635
partialEvaluatorTranslateFont([object Object],[object Object],[object Object])@http://localhost:8080/pdf.js:4889
partialEvaluatorEvaluate([object Object],[object Object],[object Object],[object Array],[object Object])@http://localhost:8080/pdf.js:4456
canvasGraphicsCompile([object Object],[object Object],[object Object],[object Array],[object Object])@http://localhost:8080/pdf.js:5006
pageCompile([object Object],[object Array],[object Object])@http://localhost:8080/pdf.js:3621
pageStartRendering([object CanvasRenderingContext2D],nextPageStartRendering)@http://localhost:8080/pdf.js:3572
nextPage([object Object])@http://localhost:8080/test/driver.js:144
snapshotCurrentPageSetTimeout(1)@http://localhost:8080/test/driver.js:172
done, snapshotting... done

loading page 37/160... error("Unknown compression method in flate stream: 71, 232")@http://localhost:8080/pdf.js:32
constructor([object Object])@http://localhost:8080/pdf.js:491
parserMakeFilter([object Object],"FlateDecode",213,(void 0))@http://localhost:8080/pdf.js:2970
parserFilter([object Object],[object Object],213)@http://localhost:8080/pdf.js:2945
parserMakeStream([object Object],[object Object])@http://localhost:8080/pdf.js:2937
parserGetObj([object Object])@http://localhost:8080/pdf.js:2816
xRefFetch([object Object])@http://localhost:8080/pdf.js:3398
partialEvaluatorExtractEncoding([object Object],[object Object],[object Object])@http://localhost:8080/pdf.js:4635
partialEvaluatorTranslateFont([object Object],[object Object],[object Object])@http://localhost:8080/pdf.js:4889
partialEvaluatorEvaluate([object Object],[object Object],[object Object],[object Array],[object Object])@http://localhost:8080/pdf.js:4456
canvasGraphicsCompile([object Object],[object Object],[object Object],[object Array],[object Object])@http://localhost:8080/pdf.js:5006
pageCompile([object Object],[object Array],[object Object])@http://localhost:8080/pdf.js:3621
pageStartRendering([object CanvasRenderingContext2D],nextPageStartRendering)@http://localhost:8080/pdf.js:3572
nextPage([object Object])@http://localhost:8080/test/driver.js:144
snapshotCurrentPageSetTimeout(-2)@http://localhost:8080/test/driver.js:172
done, snapshotting... done

Interestingly enough the 'make test' says that 'All tests passed.'.

This part of the code gobbles the thrown error:

if (this.encrypt && !suppressEncryption) {
try {
e = parser.getObj(this.encrypt.createCipherTransform(num, gen));
} catch (ex) {
// almost all streams must be encrypted, but sometimes
// they are not probably due to some broken generators
// re-trying without encryption
return this.fetch(ref, true);
}
} else {
e = parser.getObj();
}