Output page key / version information
This commit is contained in:
parent
9487eee6a9
commit
cab4dea2ba
|
@ -338,8 +338,13 @@ let extract_struct_tree pdf =
|
||||||
| None -> `List []
|
| None -> `List []
|
||||||
| Some x ->
|
| Some x ->
|
||||||
let objs = Pdf.objects_referenced ["/Pg"; "/Obj"; "/Stm"; "/StmOwn"] [] pdf x in
|
let objs = Pdf.objects_referenced ["/Pg"; "/Obj"; "/Stm"; "/StmOwn"] [] pdf x in
|
||||||
|
let zero =
|
||||||
|
`Tuple [`Int 0;
|
||||||
|
`Assoc [("/CPDFJSONformatversion", `Int 1);
|
||||||
|
("/CPDFJSONpageobjnumbers", `List (map (fun x -> `Int (unopt (Pdfpage.page_object_number pdf x))) (ilist 1 (Pdfpage.endpage pdf))))]]
|
||||||
|
in
|
||||||
`List
|
`List
|
||||||
(map
|
(zero::map
|
||||||
(fun objnum ->
|
(fun objnum ->
|
||||||
let jsonobj =
|
let jsonobj =
|
||||||
Cpdfjson.json_of_object ~utf8:true ~no_stream_data:false ~parse_content:false pdf (function _ -> ()) (Pdf.lookup_obj pdf objnum)
|
Cpdfjson.json_of_object ~utf8:true ~no_stream_data:false ~parse_content:false pdf (function _ -> ()) (Pdf.lookup_obj pdf objnum)
|
||||||
|
|
Loading…
Reference in New Issue