mirror of
https://github.com/johnwhitington/cpdf-source.git
synced 2025-02-16 11:50:54 +01:00
more
This commit is contained in:
parent
c0d474fdae
commit
15a6883f00
15
cpdfannot.ml
15
cpdfannot.ml
@ -157,14 +157,15 @@ let set_annotations_json pdf i =
|
|||||||
| `List entries ->
|
| `List entries ->
|
||||||
(* Renumber the PDF so everything has bigger object numbers than that. *)
|
(* Renumber the PDF so everything has bigger object numbers than that. *)
|
||||||
let maxobjnum =
|
let maxobjnum =
|
||||||
fold_left
|
fold_left max min_int
|
||||||
max
|
(map
|
||||||
min_int
|
(function
|
||||||
(map (fun e -> match e with `List [_; `Int i; _] -> i | `List [`Int i; _] -> abs i | _ -> error "Bad annots entry") entries)
|
| `List [_; `Int i; _] -> i
|
||||||
in
|
| `List [`Int i; _] -> abs i
|
||||||
let pdf_objnums =
|
| _ -> error "Bad annots entry")
|
||||||
map fst (list_of_hashtbl pdf.Pdf.objects.Pdf.pdfobjects)
|
entries)
|
||||||
in
|
in
|
||||||
|
let pdf_objnums = map fst (list_of_hashtbl pdf.Pdf.objects.Pdf.pdfobjects) in
|
||||||
let change_table =
|
let change_table =
|
||||||
hashtable_of_dictionary (map2 (fun f t -> (f, t)) pdf_objnums (ilist (maxobjnum + 1) (maxobjnum + length pdf_objnums)))
|
hashtable_of_dictionary (map2 (fun f t -> (f, t)) pdf_objnums (ilist (maxobjnum + 1) (maxobjnum + length pdf_objnums)))
|
||||||
in
|
in
|
||||||
|
Loading…
x
Reference in New Issue
Block a user