Expose JSON
This commit is contained in:
parent
17c8e1ae1a
commit
a4e3ca0bfa
|
@ -294,6 +294,9 @@ let json_of_font (pagenum, name, subtype, basefont, encoding) =
|
|||
("basefont", if basefont = "" then `Null else `String basefont);
|
||||
("encoding", if encoding = "" then `Null else `String encoding)]
|
||||
|
||||
let json_fonts pdf range =
|
||||
`List (map json_of_font (list_fonts pdf range))
|
||||
|
||||
let print_fonts ?(json=false) pdf range =
|
||||
if json
|
||||
then flprint (Cpdfyojson.Safe.pretty_to_string (`List (map json_of_font (list_fonts pdf range))))
|
||||
|
|
|
@ -8,6 +8,9 @@ val print_fonts : ?json:bool -> Pdf.t -> int list -> unit
|
|||
(** Return font list. Page number, name, subtype, basefont, encoding. *)
|
||||
val list_fonts : Pdf.t -> int list -> (int * string * string * string * string) list
|
||||
|
||||
(** Return font list in JSON format *)
|
||||
val json_fonts : Pdf.t -> int list -> Cpdfyojson.Safe.t
|
||||
|
||||
(** {2 Miscellany.} *)
|
||||
|
||||
(** Embed missing fonts *)
|
||||
|
|
Loading…
Reference in New Issue