From 98d37b58a595cb5a74e75a1cd869937bf5b909bf Mon Sep 17 00:00:00 2001 From: John Whitington Date: Thu, 13 Jan 2022 16:35:03 +0000 Subject: [PATCH] more --- cpdfaddtext.mli | 6 +++++- cpdfcreate.mli | 2 +- cpdfdraft.mli | 2 ++ cpdffont.mli | 31 ++++++++++++++++++++----------- cpdfimage.mli | 6 +++++- cpdftexttopdf.mli | 3 +++ cpdftweak.mli | 8 +++++++- cpdftype.mli | 2 ++ cpdfxobject.mli | 2 ++ 9 files changed, 47 insertions(+), 15 deletions(-) diff --git a/cpdfaddtext.mli b/cpdfaddtext.mli index 35416f2..7a2a867 100644 --- a/cpdfaddtext.mli +++ b/cpdfaddtext.mli @@ -1,4 +1,4 @@ -(** {2 Adding text} *) +(** Adding text *) type color = Grey of float @@ -48,6 +48,7 @@ val addtexts : Pdf.t ->(*pdf*) Pdf.t +(* Add a rectangle to the page *) val addrectangle : bool -> float * float -> @@ -69,5 +70,8 @@ val metrics_baseline_adjustment : unit -> float (** Remove text from the given pages. *) val removetext : int list -> Pdf.t -> Pdf.t +(** Extract text *) val extract_text : float option -> Pdf.t -> int list -> string + +(** Remove text *) val remove_all_text : int list -> Pdf.t -> Pdf.t diff --git a/cpdfcreate.mli b/cpdfcreate.mli index 8f666cf..7e1e9a1 100644 --- a/cpdfcreate.mli +++ b/cpdfcreate.mli @@ -1,4 +1,4 @@ -(** {2 Making new documents} *) +(** Making new documents *) (** Make a blank document given x and y page dimensions in points and a number of pages *) val blank_document : float -> float -> int -> Pdf.t diff --git a/cpdfdraft.mli b/cpdfdraft.mli index f913749..8b88dc7 100644 --- a/cpdfdraft.mli +++ b/cpdfdraft.mli @@ -1,2 +1,4 @@ +(** Remove images *) + (** Remove images from a PDF, optionally adding crossed boxes. *) val draft : string option -> bool -> int list -> Pdf.t -> Pdf.t diff --git a/cpdffont.mli b/cpdffont.mli index 3c3eee5..85168e6 100644 --- a/cpdffont.mli +++ b/cpdffont.mli @@ -1,14 +1,4 @@ -val embed_missing_fonts : string -> bool -> string -> string -> unit - -val copy_font : Pdf.t -> string -> int -> int list -> Pdf.t -> Pdf.t - -val missing_fonts : Pdf.t -> int list -> unit - -val print_font_table : Pdf.t -> string -> int -> unit - -val extract_fontfile : int -> string -> Pdf.t -> unit - -val remove_fonts : Pdf.t -> Pdf.t +(** Fonts *) (** {2 Listing fonts} *) @@ -18,3 +8,22 @@ val print_fonts : 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 +(** {2 Miscellany.} *) + +(** Embed missing fonts *) +val embed_missing_fonts : string -> bool -> string -> string -> unit + +(** Copy a font *) +val copy_font : Pdf.t -> string -> int -> int list -> Pdf.t -> Pdf.t + +(** Report missing fonts *) +val missing_fonts : Pdf.t -> int list -> unit + +(** Print a font table to Standard Output. *) +val print_font_table : Pdf.t -> string -> int -> unit + +(** Extract a font file to disk. *) +val extract_fontfile : int -> string -> Pdf.t -> unit + +(** Remove fonts from a document. *) +val remove_fonts : Pdf.t -> Pdf.t diff --git a/cpdfimage.mli b/cpdfimage.mli index 5383dcb..e0cf226 100644 --- a/cpdfimage.mli +++ b/cpdfimage.mli @@ -1,5 +1,9 @@ +(** Images *) + +(** Extract images. *) val extract_images : string -> string -> Cpdfmetadata.encoding -> bool -> bool -> Pdf.t -> int list -> string -> unit - + +(** Report image resolutions. *) val image_resolution : Pdf.t -> int list -> float -> (int * string * int * int * float * float) list diff --git a/cpdftexttopdf.mli b/cpdftexttopdf.mli index 346b05e..eb4c3a9 100644 --- a/cpdftexttopdf.mli +++ b/cpdftexttopdf.mli @@ -1 +1,4 @@ +(** Text to PDF *) + +(** Typeset a text file as a PDF. *) val typeset : papersize:Pdfpaper.t -> font:Pdftext.standard_font -> fontsize:float -> Pdfio.bytes -> Pdf.t diff --git a/cpdftweak.mli b/cpdftweak.mli index c002aec..d25f567 100644 --- a/cpdftweak.mli +++ b/cpdftweak.mli @@ -1,4 +1,4 @@ -(** {2 Miscellany} *) +(** Miscellany *) (** Make all lines in the PDF at least a certain thickness. *) val thinlines : int list -> float -> Pdf.t -> Pdf.t @@ -12,14 +12,20 @@ val blacklines : Cpdfaddtext.color -> int list -> Pdf.t -> Pdf.t (** Make all fills on certain pages black. *) val blackfills : Cpdfaddtext.color -> int list -> Pdf.t -> Pdf.t +(** Append page content. *) val append_page_content : string -> bool -> bool -> int list -> Pdf.t -> Pdf.t +(** Remove a dictionary entry. *) val remove_dict_entry : Pdf.t -> string -> Pdf.pdfobject option -> unit +(** Replace a dictionary entry. *) val replace_dict_entry : Pdf.t -> string -> Pdf.pdfobject -> Pdf.pdfobject option -> unit +(** Print a dictionary entry. *) val print_dict_entry : Pdf.t -> string -> unit +(** Remove clipping. *) val remove_clipping : Pdf.t -> int list -> Pdf.t +(** Remove unused resources. *) val remove_unused_resources : Pdf.t -> Pdf.t diff --git a/cpdftype.mli b/cpdftype.mli index 00c96ba..fad857e 100644 --- a/cpdftype.mli +++ b/cpdftype.mli @@ -1,3 +1,5 @@ +(** Experimental typesetter for cpdf *) + type glue = {glen : float; gstretch : float} diff --git a/cpdfxobject.mli b/cpdfxobject.mli index f1b0f96..e25c4cb 100644 --- a/cpdfxobject.mli +++ b/cpdfxobject.mli @@ -1,2 +1,4 @@ +(** XObjects *) +(** Stamp a PDF as an xobject in another. *) val stamp_as_xobject : Pdf.t -> int list -> Pdf.t -> Pdf.t * string