More work on new bookmarks format

This commit is contained in:
John Whitington 2017-11-04 16:24:14 +00:00
parent 0478f186b1
commit 576919a5ce
2 changed files with 10 additions and 2 deletions

Binary file not shown.

12
cpdf.ml
View File

@ -966,10 +966,18 @@ let bookmark_of_data pdf i s i' isopen optionaldest =
let pdfobj =
Pdfread.parse_single_object s
in
Printf.printf "Parsed %s\n" (Pdfwrite.string_of_pdf pdfobj);
(*Printf.printf "Parsed %s\n" (Pdfwrite.string_of_pdf pdfobj);*)
begin match pdfobj with
Pdf.Array (Pdf.Integer x::more) ->
Pdfdest.read_destination (Pdf.empty ()) (Pdf.Array (Pdf.Indirect 0::more))
let pageobjnum = Pdfpage.page_object_number pdf i' in
begin match pageobjnum with
None ->
raise (Pdf.PDFError "bookmark_of_data: page obj num not found")
| Some p ->
Pdfdest.read_destination
(Pdf.empty ())
(Pdf.Array (Pdf.Indirect p::more))
end
| _ ->
raise (Pdf.PDFError "bookmark_of_data: dest")
end