This commit is contained in:
John Whitington 2024-09-03 17:56:44 +01:00
parent 094a0d01b5
commit 5f340a3b65
1 changed files with 4 additions and 0 deletions

View File

@ -3477,6 +3477,7 @@ let print_obj pdf objspec =
(* Empty string is trailerdict. Begins with / and it's a chain separated by commas. *) (* Empty string is trailerdict. Begins with / and it's a chain separated by commas. *)
let replace_obj pdf objspec obj = let replace_obj pdf objspec obj =
Printf.printf "objspec = %s\n" objspec;
let key, chain = let key, chain =
let r, rest = cleavewhile (neq '/') (rev (explode objspec)) in let r, rest = cleavewhile (neq '/') (rev (explode objspec)) in
(implode ('/'::rev r), split_chain (implode (rev (tl rest)))) (implode ('/'::rev r), split_chain (implode (rev (tl rest))))
@ -3492,6 +3493,9 @@ let replace_obj pdf objspec obj =
| h::t -> Pdf.Dictionary [(h, wrap_obj obj t)] | h::t -> Pdf.Dictionary [(h, wrap_obj obj t)]
in in
let chain, to_fake = find_max_existing [] chain in let chain, to_fake = find_max_existing [] chain in
Printf.printf "to_fake is:\n";
iter (Printf.printf "%s ") to_fake;
Printf.printf "\n";
let obj = wrap_obj obj to_fake in let obj = wrap_obj obj to_fake in
Printf.printf "obj is %s\n" (Pdfwrite.string_of_pdf obj); Printf.printf "obj is %s\n" (Pdfwrite.string_of_pdf obj);
Printf.printf "chain is:\n"; Printf.printf "chain is:\n";