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

Only trigger warning bar on certain unsupported features.

This commit is contained in:
Brendan Dahl 2014-01-03 09:34:13 -08:00
parent 1bada35388
commit 2228343f77
11 changed files with 70 additions and 74 deletions

View file

@ -19,8 +19,9 @@
info, isArray, isCmd, isDict, isEOF, isName, isNum,
isStream, isString, JpegStream, Lexer, Metrics, Name, Parser,
Pattern, PDFImage, PDFJS, serifFonts, stdFontMap, symbolsFonts,
TilingPattern, TODO, warn, Util, Promise,
RefSetCache, isRef, TextRenderingMode, CMapFactory, OPS */
TilingPattern, warn, Util, Promise, UnsupportedManager,
RefSetCache, isRef, TextRenderingMode, CMapFactory, OPS,
UNSUPPORTED_FEATURES */
'use strict';
@ -407,9 +408,9 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
gStateObj.push([key, value]);
break;
case 'SMask':
// We support the default so don't trigger the TODO.
// We support the default so don't trigger a warning bar.
if (!isName(value) || value.name != 'None')
TODO('graphic state operator ' + key);
UnsupportedManager.notify(UNSUPPORTED_FEATURES.smask);
break;
// Only generate info log messages for the following since
// they are unlikey to have a big impact on the rendering.
@ -499,6 +500,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
try {
translated = this.translateFont(font, xref);
} catch (e) {
UnsupportedManager.notify(UNSUPPORTED_FEATURES.font);
translated = new ErrorFont(e instanceof Error ? e.message : e);
}
font.translated = translated;