1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 01:58:06 +02:00

Properly cancel streams and guard at getTextContent.

This commit is contained in:
Yury Delendik 2017-08-03 16:36:46 -05:00
parent 0c95bc7d83
commit a1dfbec532
3 changed files with 28 additions and 7 deletions

View file

@ -14,10 +14,10 @@
*/
import {
assert, CMapCompressionType, createPromiseCapability, FONT_IDENTITY_MATRIX,
FormatError, getLookupTableFactory, IDENTITY_MATRIX, ImageKind, info, isArray,
isNum, isString, NativeImageDecoding, OPS, TextRenderingMode,
UNSUPPORTED_FEATURES, Util, warn
AbortException, assert, CMapCompressionType, createPromiseCapability,
FONT_IDENTITY_MATRIX, FormatError, getLookupTableFactory, IDENTITY_MATRIX,
ImageKind, info, isArray, isNum, isString, NativeImageDecoding, OPS,
TextRenderingMode, UNSUPPORTED_FEATURES, Util, warn
} from '../shared/util';
import { CMapFactory, IdentityCMap } from './cmap';
import { DecodeStream, JpegStream, Stream } from './stream';
@ -1744,6 +1744,9 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
enqueueChunk();
resolve();
}).catch((reason) => {
if (reason instanceof AbortException) {
return;
}
if (this.options.ignoreErrors) {
// Error(s) in the TextContent -- allow text-extraction to continue.
warn('getTextContent - ignoring errors during task: ' + task.name);