Expose into cpdflib

This commit is contained in:
John Whitington 2023-08-31 14:52:24 +01:00
parent b5f80289db
commit 08c19e5b2e
6 changed files with 13 additions and 3 deletions

View File

@ -2,8 +2,8 @@
let demo = false let demo = false
let noncomp = false let noncomp = false
let major_version = 2 let major_version = 2
let minor_version = 6 let minor_version = 7
let version_date = "(24th July 2023)" let version_date = "(devel, 21st August 2023)"
open Pdfutil open Pdfutil
open Pdfio open Pdfio

View File

@ -137,6 +137,9 @@ let show_composition_json filesize pdf =
`Tuple [`String "XRef Table"; `Int xref_table; `Float (perc xref_table)]; `Tuple [`String "XRef Table"; `Int xref_table; `Float (perc xref_table)];
`Tuple [`String "Unclassified"; `Int (filesize - r); `Float (perc (filesize - r))]] `Tuple [`String "Unclassified"; `Int (filesize - r); `Float (perc (filesize - r))]]
let show_composition_json_blob filesize pdf =
Pdfio.bytes_of_string (Cpdfyojson.Safe.pretty_to_string (show_composition_json filesize pdf))
let show_composition filesize json pdf = let show_composition filesize json pdf =
let module J = Cpdfyojson.Safe in let module J = Cpdfyojson.Safe in
let j = show_composition_json filesize pdf in let j = show_composition_json filesize pdf in

View File

@ -3,3 +3,5 @@
(** [show_composition filesize json pdf] prints the composition of a document to (** [show_composition filesize json pdf] prints the composition of a document to
Standard Output. *) Standard Output. *)
val show_composition : int -> bool -> Pdf.t -> unit val show_composition : int -> bool -> Pdf.t -> unit
val show_composition_json_blob : int -> Pdf.t -> Pdfio.bytes

Binary file not shown.

View File

@ -2952,7 +2952,7 @@ given page range.
\small\noindent\verb!cpdf -info [-raw | -utf8] in.pdf! \small\noindent\verb!cpdf -info [-raw | -utf8] in.pdf!
\vspace{1.5mm} \vspace{1.5mm}
\small\noindent\verb!cpdf -page-info in.pdf! \small\noindent\verb!cpdf -page-info in.pdf [<range>]!
\vspace{1.5mm} \vspace{1.5mm}
\small\noindent\verb!cpdf -pages in.pdf! \small\noindent\verb!cpdf -pages in.pdf!

View File

@ -79,3 +79,8 @@ val set_metadata_date : Pdf.t -> string -> Pdf.t
(** Expands the date ["now"] to the date now. Leaves any other string alone. *) (** Expands the date ["now"] to the date now. Leaves any other string alone. *)
val expand_date : string -> string val expand_date : string -> string
(** / **)
val get_catalog_item : string -> Pdf.t -> string
val get_viewer_pref_item : string -> Pdf.t -> string