mirror of
https://github.com/johnwhitington/cpdf-source.git
synced 2025-04-14 18:32:54 +02:00
First working roundtrip structure tree
This commit is contained in:
parent
17762e35a0
commit
02e220ec1a
@ -1,9 +1,6 @@
|
|||||||
(** Two exceptions recommended for use with the library, though currently not
|
(** Two exceptions recommended for use with the library. *)
|
||||||
raised by any function in this module. Cpdfcommand uses them extensively. *)
|
|
||||||
exception SoftError of string
|
exception SoftError of string
|
||||||
|
|
||||||
exception HardError of string
|
exception HardError of string
|
||||||
|
|
||||||
let error s = raise (SoftError s)
|
let error s = raise (SoftError s)
|
||||||
|
|
||||||
|
|
||||||
|
@ -363,7 +363,7 @@ let replace_struct_tree pdf (json : Cpdfyojson.Safe.t) =
|
|||||||
| Pdf.Indirect i ->
|
| Pdf.Indirect i ->
|
||||||
begin match lookup i negobjnummap with
|
begin match lookup i negobjnummap with
|
||||||
| Some x -> Pdf.Indirect x
|
| Some x -> Pdf.Indirect x
|
||||||
| None -> error "rewrite_indirects"
|
| None -> Pdf.Indirect i
|
||||||
end
|
end
|
||||||
| Pdf.Dictionary d -> Pdf.recurse_dict (rewrite_indirects negobjnummap) d
|
| Pdf.Dictionary d -> Pdf.recurse_dict (rewrite_indirects negobjnummap) d
|
||||||
| Pdf.Array a -> Pdf.recurse_array (rewrite_indirects negobjnummap) a
|
| Pdf.Array a -> Pdf.recurse_array (rewrite_indirects negobjnummap) a
|
||||||
|
Loading…
x
Reference in New Issue
Block a user