Scaffolding for -list-images
This commit is contained in:
parent
33c690343c
commit
53e3d92a81
3
Changes
3
Changes
|
@ -7,13 +7,14 @@ o Spray splits a file to multiple outputs by alternating pages
|
|||
o List document and page info in JSON format
|
||||
o List page labels in JSON format
|
||||
o List fonts in JSON format
|
||||
o Identify PDF/A, PDF/X, PDF/E, PDF/VT, PDF/UA
|
||||
o Identify PDF/A, PDF/X, PDF/E, PDF/VT, PDF/UA in -info
|
||||
o Extract font files from a document
|
||||
o List images on a page with -list-images[-json]
|
||||
|
||||
Extended features:
|
||||
|
||||
o -list-images-used[-json] extends -image-resolution
|
||||
o Use -raw with -extract-images to get PNMs
|
||||
|
||||
Fixes:
|
||||
|
||||
|
|
|
@ -4177,8 +4177,13 @@ let go () =
|
|||
Printf.printf "%i, %s, %i, %i, %f, %f\n" pagenum xobject w h wdpi hdpi)
|
||||
images
|
||||
| Some ListImages ->
|
||||
(* FIXME Implement ListImages *)
|
||||
()
|
||||
let pdf = get_single_pdf args.op true in
|
||||
let range = parse_pagespec_allow_empty pdf (get_pagespec ()) in
|
||||
let json = Cpdfimage.images pdf range in
|
||||
if args.format_json then
|
||||
flprint (Cpdfyojson.Safe.pretty_to_string json)
|
||||
else
|
||||
flprint "old fashioned output\n"
|
||||
| Some MissingFonts ->
|
||||
let pdf = get_single_pdf args.op true in
|
||||
let range = parse_pagespec_allow_empty pdf (get_pagespec ()) in
|
||||
|
|
|
@ -272,6 +272,8 @@ let image_resolution pdf range dpi =
|
|||
image_resolution pdf range dpi;
|
||||
rev !image_results
|
||||
|
||||
let images pdf range = `Null
|
||||
|
||||
let obj_of_jpeg_data data =
|
||||
let w, h = Cpdfjpeg.jpeg_dimensions data in
|
||||
let d =
|
||||
|
|
|
@ -8,6 +8,9 @@ val extract_images : ?raw:bool -> ?path_to_p2p:string ->
|
|||
(** Report image resolutions. *)
|
||||
val image_resolution : Pdf.t -> int list -> float -> (int * string * int * int * float * float) list
|
||||
|
||||
(** List images in JSON format *)
|
||||
val images : Pdf.t -> int list -> Cpdfyojson.Safe.t
|
||||
|
||||
(**/**)
|
||||
val image_of_input : (Pdfio.bytes -> Pdf.pdfobject) -> Pdfio.input -> Pdf.t
|
||||
val obj_of_jpeg_data : Pdfio.bytes -> Pdf.pdfobject
|
||||
|
|
Loading…
Reference in New Issue