Hardened against XML parsing failures in metadata reading

This commit is contained in:
John Whitington 2014-10-24 11:43:37 +01:00
parent 19b9d56c5a
commit 898776ee73
1 changed files with 15 additions and 12 deletions

View File

@ -2932,6 +2932,7 @@ let output_xmp_info encoding pdf =
match get_metadata pdf with
None -> ()
| Some metadata ->
try
let dtd, tree = xmltree_of_bytes metadata in
print_out tree "XMP pdf:Keywords" adobe "Keywords";
print_out tree "XMP pdf:PDFVersion" adobe "PDFVersion";
@ -2944,6 +2945,8 @@ let output_xmp_info encoding pdf =
print_out tree "XMP dc:title" dc "title";
print_out tree "XMP dc:creator" dc "creator";
print_out tree "XMP dc:subject" dc "subject"
with
_ -> ()
(* \section{Blacken text} *)