diff --git a/cpdfannot.mli b/cpdfannot.mli index a25711a..cc76d26 100644 --- a/cpdfannot.mli +++ b/cpdfannot.mli @@ -1,4 +1,4 @@ -(** {2 Annotations} *) +(** Annotations *) (** List the annotations to standard output in a given encoding. See cpdfmanual.pdf for the format details. *) val list_annotations : json:bool -> Cpdfmetadata.encoding -> Pdf.t -> unit diff --git a/cpdfcommand.ml b/cpdfcommand.ml index 7770e1c..fd7f09f 100644 --- a/cpdfcommand.ml +++ b/cpdfcommand.ml @@ -3,7 +3,7 @@ let demo = false let noncomp = false let major_version = 2 let minor_version = 5 -let version_date = "(9th Jan 2022)" +let version_date = "(14th Jan 2022)" open Pdfutil open Pdfio diff --git a/cpdfimpose.mli b/cpdfimpose.mli index 2608596..605fcb1 100644 --- a/cpdfimpose.mli +++ b/cpdfimpose.mli @@ -1,12 +1,13 @@ -(** {2 Imposition} *) +(** Imposition *) +(** Imposition. See cpdfmanual.pdf for details. *) val impose : x:float -> y:float -> fit:bool -> columns:bool -> rtl:bool -> btt:bool -> center:bool -> margin:float -> spacing:float -> linewidth:float -> fast:bool -> Pdf.t -> Pdf.t -(** The twoup_stack operation puts two logical pages on each physical page, +(** The legacy twoup_stack operation puts two logical pages on each physical page, rotating them 90 degrees to do so. The new mediabox is thus larger. Bool true (fast) if assume well-formed ISO content streams. *) val twoup_stack : bool -> Pdf.t -> Pdf.t -(** The twoup operation does the same, but scales the new sides down so that +(** The legacy twoup operation does the same, but scales the new sides down so that the media box is unchanged. Bool true (fast) if assume well-formed ISO content streams. *) val twoup : bool -> Pdf.t -> Pdf.t diff --git a/cpdfocg.mli b/cpdfocg.mli index 8d13d01..9b2c89a 100644 --- a/cpdfocg.mli +++ b/cpdfocg.mli @@ -1,9 +1,16 @@ -val ocg_coalesce : Pdf.t -> unit +(** Optional content groups *) +(** Return list of OCG names. *) val ocg_get_list : Pdf.t -> string list +(** Print OCG list to Standard Output. *) val ocg_list : Pdf.t -> unit +(** Coalesce same-named OCGs resulting from merge. *) +val ocg_coalesce : Pdf.t -> unit + +(** Rename an OCG. *) val ocg_rename : string -> string -> Pdf.t -> unit +(** Make sure every OCG is in the /Order. *) val ocg_order_all : Pdf.t -> unit diff --git a/cpdfpad.mli b/cpdfpad.mli index ba599a0..f9a4b3e 100644 --- a/cpdfpad.mli +++ b/cpdfpad.mli @@ -1,4 +1,4 @@ -(** {2 Padding} *) +(** Padding *) (** Put blank pages before the given page numbers *) val padbefore : ?padwith:Pdf.t -> int list -> Pdf.t -> Pdf.t diff --git a/cpdfpage.mli b/cpdfpage.mli index a9fbf3b..e9dfad4 100644 --- a/cpdfpage.mli +++ b/cpdfpage.mli @@ -1,4 +1,4 @@ -(** {2 Working with pages} *) +(** Working with pages *) (** Print page info (Mediabox etc) to standard output. *) val output_page_info : Pdf.t -> int list -> unit @@ -14,14 +14,22 @@ val iter_pages : (int -> Pdfpage.t -> unit) -> Pdf.t -> int list -> unit (** Same as [process_pages] but return the list of outputs of the map function. *) val map_pages : (int -> Pdfpage.t -> 'a) -> Pdf.t -> int list -> 'a list +(** Clip a page to one of its boxes, or the media box if that box is not + present. This is a hard clip, done by using a clipping rectangle, so that the + page may then be used as a stamp without extraneous material reapearing. *) val hard_box : Pdf.t -> int list -> string -> bool -> bool -> Pdf.t (** Shift a PDF in x and y (in pts) in the given pages. List of (x, y) pairs is for all pages in pdf. *) val shift_pdf : ?fast:bool -> (float * float) list -> Pdf.t -> int list -> Pdf.t +(** Change a page's media box so its minimum x and y are 0, making other +operations simpler to think about. Any shift that is done is reflected in +other boxes (clip etc.) *) val rectify_boxes : ?fast:bool -> Pdf.t -> Pdfpage.t -> Pdfpage.t +(** Change the media box and other known boxes by a function which takes +xmin, xmax, ymin, ymax as input. *) val change_boxes : (float * float * float * float -> float * float * float * float) -> Pdf.t -> Pdfpage.t -> Pdfpage.t @@ -98,10 +106,14 @@ val vflip_pdf : ?fast:bool -> Pdf.t -> int list -> Pdf.t (** Flip the given pages horizontally *) val hflip_pdf : ?fast:bool -> Pdf.t -> int list -> Pdf.t +(** Add trim marks. *) val trim_marks : ?fast:bool -> Pdf.t -> int list -> Pdf.t +(** Show the page boxes for debug. *) val show_boxes : ?fast:bool -> Pdf.t -> int list -> Pdf.t +(** Copy one box to another in the given pages. *) val copy_box : string -> string -> bool -> Pdf.t -> int list -> Pdf.t +(** True if all pages are "upright" i.e no rotation and (0,0)-based. *) val allupright : int list -> Pdf.t -> bool diff --git a/cpdfpagelabels.mli b/cpdfpagelabels.mli index 3083233..9146940 100644 --- a/cpdfpagelabels.mli +++ b/cpdfpagelabels.mli @@ -1,6 +1,5 @@ -(** {2 Page labels} *) +(** Page labels *) (** Add page labels. *) val add_page_labels : Pdf.t -> bool -> Pdfpagelabels.labelstyle -> string option -> int -> int list -> unit - diff --git a/cpdfspot.mli b/cpdfspot.mli index 2c11426..7b4b263 100644 --- a/cpdfspot.mli +++ b/cpdfspot.mli @@ -1 +1,4 @@ +(** Spot colours *) + +(** List spot colours to Standard Output. *) val list_spot_colours : Pdf.t -> unit diff --git a/cpdfsqueeze.mli b/cpdfsqueeze.mli index b2d42d4..e532f6f 100644 --- a/cpdfsqueeze.mli +++ b/cpdfsqueeze.mli @@ -1,3 +1,5 @@ +(** Lossless compression *) + (** Compresses all streams in the PDF document which are uncompressed, using /FlateDecode, leaving out metadata. If the PDF is encrypted, does nothing. *) val recompress_pdf : Pdf.t -> Pdf.t diff --git a/cpdftoc.mli b/cpdftoc.mli index 7e8e6c3..9f749a5 100644 --- a/cpdftoc.mli +++ b/cpdftoc.mli @@ -1 +1,4 @@ +(** Table of contents *) + +(** Typeset a table of contents and prepend to the document. *) val typeset_table_of_contents : font:Pdftext.standard_font -> fontsize:float -> title:string -> bookmark:bool -> Pdf.t -> Pdf.t