Fail gracefully, and with a notification, if paintXObject is encountered in canvas.js
We should never actually try to execute `paintXObject` in canvas.js, but in some cases where we fail to parse the PDF file correctly it can happen. Currently this will potentially cause an entire page to fail to render, which seems suboptimal. With this patch, we will instead continue rendering with a warning that things might not work correctly.
This commit is contained in:
parent
2e751199fb
commit
487ba9065a
@ -14,10 +14,10 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* globals error, PDFJS, assert, info, shadow, TextRenderingMode,
|
||||
FONT_IDENTITY_MATRIX, Uint32ArrayView, IDENTITY_MATRIX, ImageData,
|
||||
ImageKind, isArray, isNum, TilingPattern, OPS, Util, warn,
|
||||
getShadingPatternFromIR, WebGLUtils */
|
||||
/* globals IDENTITY_MATRIX, FONT_IDENTITY_MATRIX, TextRenderingMode, ImageData,
|
||||
ImageKind, PDFJS, Uint32ArrayView, error, WebGLUtils, OPS, warn,
|
||||
shadow, isNum, Util, TilingPattern, getShadingPatternFromIR, isArray,
|
||||
info, assert, UnsupportedManager, UNSUPPORTED_FEATURES */
|
||||
|
||||
'use strict';
|
||||
|
||||
@ -2073,6 +2073,11 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
||||
this.ctx.fillRect(0, 0, 1, 1);
|
||||
},
|
||||
|
||||
paintXObject: function CanvasGraphics_paintXObject() {
|
||||
UnsupportedManager.notify(UNSUPPORTED_FEATURES.unknown);
|
||||
warn('Unsupported \'paintXObject\' command.');
|
||||
},
|
||||
|
||||
// Marked content
|
||||
|
||||
markPoint: function CanvasGraphics_markPoint(tag) {
|
||||
|
Loading…
Reference in New Issue
Block a user