From a6f4a9228671983665684f1aaf1563f26154d50a Mon Sep 17 00:00:00 2001 From: Adil Allawi Date: Tue, 5 Jul 2011 23:14:20 +0100 Subject: [PATCH 1/2] 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. --- pdf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdf.js b/pdf.js index a9f0ee935..132d16ec1 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; From 5d337b1c767833e86d1c9d73dba2d2d93de9645b Mon Sep 17 00:00:00 2001 From: Adil Allawi Date: Wed, 6 Jul 2011 00:43:47 +0100 Subject: [PATCH 2/2] Added sample OpenOffice file to tests --- test/pdfs/DiwanProfile.pdf.link | 1 + test/test_manifest.json | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 test/pdfs/DiwanProfile.pdf.link diff --git a/test/pdfs/DiwanProfile.pdf.link b/test/pdfs/DiwanProfile.pdf.link new file mode 100644 index 000000000..12694632f --- /dev/null +++ b/test/pdfs/DiwanProfile.pdf.link @@ -0,0 +1 @@ +http://oannis.com/DiwanProfile.pdf \ No newline at end of file diff --git a/test/test_manifest.json b/test/test_manifest.json index 4302e1f6e..d8a8e8f7d 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -42,5 +42,11 @@ "link": true, "rounds": 1, "type": "eq" + }, + { "id": "openoffice-pdf", + "file": "pdfs/DiwanProfile.pdf", + "link": true, + "rounds": 1, + "type": "load" } ]