summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2021-09-16 06:59:14 +0930
committerAlbert Astals Cid <tsdgeos@yahoo.es>2021-09-15 21:58:00 +0000
commitb10e715b6a12d63922e428512d2d14682fd1cefc (patch)
tree6d21ce8c5b8809e8cd6744a4a0fafeff4a5f4157
parent2bcf030e294cddf47abb63d53944b5e932848917 (diff)
Ignore custom metadata that is not a string
-rw-r--r--utils/pdfinfo.cc32
1 files changed, 17 insertions, 15 deletions
diff --git a/utils/pdfinfo.cc b/utils/pdfinfo.cc
index 73bbbc76..b46d1aa3 100644
--- a/utils/pdfinfo.cc
+++ b/utils/pdfinfo.cc
@@ -679,22 +679,24 @@ static void printCustomInfo(PDFDoc *doc, const UnicodeMap *uMap)
printInfoDate(info.getDict(), "ModDate", "ModDate: ", uMap);
}
} else {
- // print key
- Unicode *u;
- int len = utf8ToUCS4(key.c_str(), &u);
- printUCS4String(u, len, uMap);
- fputs(":", stdout);
- while (len < 15) {
- fputs(" ", stdout);
- len++;
- }
- gfree(u);
-
- // print value
Object obj = dict->lookup(key.c_str());
- GooString val_str(obj.getString());
- printTextString(&val_str, uMap);
- fputc('\n', stdout);
+ if (obj.isString()) {
+ // print key
+ Unicode *u;
+ int len = utf8ToUCS4(key.c_str(), &u);
+ printUCS4String(u, len, uMap);
+ fputs(":", stdout);
+ while (len < 15) {
+ fputs(" ", stdout);
+ len++;
+ }
+ gfree(u);
+
+ // print value
+ GooString val_str(obj.getString());
+ printTextString(&val_str, uMap);
+ fputc('\n', stdout);
+ }
}
}
}