Delete XML declaration from XMP

This commit is contained in:
John Whitington 2024-06-03 14:31:59 +01:00
parent 0b92041b1a
commit a56f222b00
1 changed files with 3 additions and 1 deletions

View File

@ -314,7 +314,9 @@ let bytes_of_xmltree t =
| D d -> `Data d | D d -> `Data d
in in
Cpdfxmlm.output_doc_tree frag o t; Cpdfxmlm.output_doc_tree frag o t;
bytes_of_string (Buffer.contents buf) (* Delete the ?xml declaration, per XMP spec. *)
let s = Buffer.contents buf in
bytes_of_string (String.sub s 39 (String.length s - 39))
let rec string_of_xmltree = function let rec string_of_xmltree = function
D d -> D d ->