From 48811f362b1fe3035808720483507c896e39c477 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Sun, 27 May 2012 19:00:13 -0500 Subject: [PATCH] Skipping incorrectly encoded metadata --- src/obj.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/obj.js b/src/obj.js index 3b7eb563b..43ec84723 100644 --- a/src/obj.js +++ b/src/obj.js @@ -152,7 +152,11 @@ var Catalog = (function CatalogClosure() { // arbitrary charsets, let's just hope that the author of the PDF // was reasonable enough to stick with the XML default charset, // which is UTF-8. - metadata = stringToUTF8String(bytesToString(stream.getBytes())); + try { + metadata = stringToUTF8String(bytesToString(stream.getBytes())); + } catch (e) { + log('Skipping invalid metadata.'); + } } }