From: Adil Allawi Date: Tue, 5 Jul 2011 22:14:20 +0000 (+0100) Subject: OpenOffice includes the optional reference to a Font dictionary in the Resources... X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=a6f4a9228671983665684f1aaf1563f26154d50a;p=pdf.js.git OpenOffice includes the optional reference to a Font dictionary in the Resources dictionary. This breaks SetFont in pdf.js as the Font in this.res is not a dictionary but an xref. --- diff --git a/pdf.js b/pdf.js index a9f0ee9..132d16e 100644 --- a/pdf.js +++ b/pdf.js @@ -3803,7 +3803,7 @@ var CanvasGraphics = (function() { this.current.leading = leading; }, setFont: function(fontRef, size) { - var font = this.res.get("Font"); + var font = this.xref.fetchIfRef(this.res.get("Font")); if (!IsDict(font)) return;