From 195446e653ff56373af187114cf85d58b97dd6f0 Mon Sep 17 00:00:00 2001 From: Tissevert Date: Mon, 10 Feb 2020 17:41:44 +0100 Subject: [PATCH] Allow resources with no /Font field, they won't cause any problem as long as no call to Tf (to load a font) is made --- src/PDF/Pages.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/PDF/Pages.hs b/src/PDF/Pages.hs index 8ed29f8..0500e97 100755 --- a/src/PDF/Pages.hs +++ b/src/PDF/Pages.hs @@ -64,8 +64,7 @@ getFontDictionary :: Dictionary -> T Dictionary getFontDictionary pageDict = key "Resources" pageDict //= getResource - \\= key "Font" - >>= getResource + >>= either (const $ return Map.empty) getResource . key "Font" cache :: (ObjectId -> T Font) -> ObjectId -> T Font cache loader objectId =