cpdf-source/cpdfbookmarks.mli

37 lines
1.7 KiB
OCaml
Raw Normal View History

2022-01-13 16:18:21 +01:00
(** Bookmarks *)
2021-12-21 14:44:46 +01:00
(** [parse_bookmark_file verify pdf input] parses the bookmark file in [input].
2022-01-13 16:18:21 +01:00
Details of the bookmark file format can be found in cpdfmanual.pdf. *)
2021-12-21 14:44:46 +01:00
val parse_bookmark_file : bool -> Pdf.t -> Pdfio.input -> Pdfmarks.t list
(** [add_bookmarks verify input pdf] adds bookmarks from the bookmark file
give. If [verify] is given, bookmarks will be verified to ensure, for example,
2022-01-13 16:18:21 +01:00
that they are not out of the page range. In the new JSON format if chosen. *)
2021-12-21 14:44:46 +01:00
val add_bookmarks : json:bool -> bool -> Pdfio.input -> Pdf.t -> Pdf.t
(** [list_bookmarks encoding range pdf output] lists the bookmarks to the given
2022-01-13 16:18:21 +01:00
output in the format specified in cpdfmanual.pdf. In the new JSON format if
chosen. *)
2021-12-21 14:44:46 +01:00
val list_bookmarks : json:bool -> Cpdfmetadata.encoding -> int list -> Pdf.t -> Pdfio.output -> unit
2021-12-21 15:57:42 +01:00
2022-01-16 19:39:42 +01:00
(** Get bookmarks in JSON format. *)
val get_bookmarks_json : Pdf.t -> Pdfio.bytes
2022-01-13 16:18:21 +01:00
(** [name_of_spec encoding marks pdf splitlevel spec n filename startpage
endpage] expands a bookmark specifiation filename. *)
2021-12-21 15:57:42 +01:00
val name_of_spec : Cpdfmetadata.encoding ->
Pdfmarks.t list ->
Pdf.t -> int -> string -> int -> string -> int -> int -> string
2021-12-21 16:06:40 +01:00
2022-01-13 16:18:21 +01:00
(** Indent bookmarks in each file by one and add a title bookmark pointing to
the first page. If the boolean is set, then use the PDF's metadata title
instead of the filename. *)
2021-12-21 16:06:40 +01:00
val add_bookmark_title : string -> bool -> Pdf.t -> Pdf.t
2021-12-21 16:33:56 +01:00
2022-01-13 16:18:21 +01:00
(** Set bookmarks to be open to the given level. *)
2021-12-21 16:06:40 +01:00
val bookmarks_open_to_level : int -> Pdf.t -> Pdf.t
2021-12-21 16:33:56 +01:00
2022-01-13 16:18:21 +01:00
(** Alter bookmark destinations given a hash table of (old page reference
number, new page reference number) pairings *)
2021-12-21 16:33:56 +01:00
val change_bookmark : (int, int) Hashtbl.t -> Pdfmarks.t -> Pdfmarks.t