First working roundtrip structure tree

This commit is contained in:
John Whitington 2024-06-05 15:26:12 +01:00
parent 17762e35a0
commit 02e220ec1a
2 changed files with 2 additions and 5 deletions

View File

@ -1,9 +1,6 @@
(** Two exceptions recommended for use with the library, though currently not
raised by any function in this module. Cpdfcommand uses them extensively. *)
(** Two exceptions recommended for use with the library. *)
exception SoftError of string
exception HardError of string
let error s = raise (SoftError s)

View File

@ -363,7 +363,7 @@ let replace_struct_tree pdf (json : Cpdfyojson.Safe.t) =
| Pdf.Indirect i ->
begin match lookup i negobjnummap with
| Some x -> Pdf.Indirect x
| None -> error "rewrite_indirects"
| None -> Pdf.Indirect i
end
| Pdf.Dictionary d -> Pdf.recurse_dict (rewrite_indirects negobjnummap) d
| Pdf.Array a -> Pdf.recurse_array (rewrite_indirects negobjnummap) a