From c55bd10d11d4bfe9398451dafe8244da399890f2 Mon Sep 17 00:00:00 2001 From: John Whitington Date: Fri, 28 Jun 2019 18:05:55 +0100 Subject: [PATCH] Booleans for trapped and untrapped --- cpdf.ml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cpdf.ml b/cpdf.ml index cc9a6ef..ef34ba6 100644 --- a/cpdf.ml +++ b/cpdf.ml @@ -3381,8 +3381,13 @@ let rec set_xml_field only_when_present kind fieldname value = function let set_pdf_info_xml only_when_present kind fieldname value xmldata pdf = let dtd, tree = xmltree_of_bytes xmldata in - (* FIXME NEED BOOLEANS HERE FOR TRAPPED/UNTRAPPED *) - let str = match value with Pdf.String s -> s | _ -> failwith "set_pdf_info_xml: not a string" in + let str = + match value with + Pdf.String s -> s + | Pdf.Boolean true -> "True" + | Pdf.Boolean false -> "False" + | _ -> failwith "set_pdf_info_xml: not a string" + in let newtree = set_xml_field only_when_present kind fieldname str tree in bytes_of_xmltree (dtd, newtree)