Skipping incorrectly encoded metadata

This commit is contained in:
Yury Delendik 2012-05-27 19:00:13 -05:00
parent 413e5357b9
commit 48811f362b

View File

@ -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.');
}
}
}