2013-08-20 16:32:57 +02:00
(* * Coherent PDF Tools Core Routines *)
open Pdfutil
2013-08-27 18:35:16 +02:00
(* * {2 Types and Exceptions} *)
2013-08-28 16:29:46 +02:00
(* * Possible output encodings for some function. [Raw] does no processing at
all - the PDF string is output as - is . [ UTF8 ] converts loslessly to UTF8 .
[ Stripped ] extracts the unicode codepoints and returns only those which
correspond to 7 bit ASCII . * )
2013-08-20 16:32:57 +02:00
type encoding = Raw | UTF8 | Stripped
2013-08-27 18:35:16 +02:00
exception SoftError of string
exception HardError of string
2013-08-28 16:29:46 +02:00
(* * Two exceptions recommended for use with the library, though currently not
raised by any function in this module . Cpdfcommand uses them extensively . * )
2013-08-27 18:35:16 +02:00
(* * {2 Debug} *)
(* * Debug: Print out a PDF in readable form to the terminal *)
val print_pdf_objs : Pdf . t -> unit
(* * {2 Working with pages} *)
(* * Like [Pdfpage.endpage], but from an input and possible password - does the
minimal work to find the number of pages . * )
2014-12-11 20:36:43 +01:00
val endpage_io : ? revision : int -> Pdfio . input -> string option -> string option -> int
2013-08-27 18:35:16 +02:00
(* * Given a function from page number and page to page, a document, and a list
of page numbers to apply it to , apply the function to all those pages . * )
2021-05-27 18:31:12 +02:00
val process_pages : ( int -> Pdfpage . t -> Pdfpage . t * int * Pdftransform . transform_matrix ) ->
Pdf . t -> int list -> Pdf . t
2013-08-27 18:35:16 +02:00
2013-08-28 16:29:46 +02:00
(* * Same as [process_pages], but iterate rather than map. *)
2013-08-27 18:35:16 +02:00
val iter_pages : ( int -> Pdfpage . t -> unit ) -> Pdf . t -> int list -> unit
2013-08-28 16:29:46 +02:00
(* * Same as [process_pages] but return the list of outputs of the map function. *)
2013-08-27 18:35:16 +02:00
val map_pages : ( int -> Pdfpage . t -> ' a ) -> Pdf . t -> int list -> ' a list
2015-07-26 13:31:43 +02:00
2013-08-20 16:32:57 +02:00
(* * 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
2013-08-28 16:29:46 +02:00
(* * Decompresses all streams in a PDF document, assuming it isn't encrypted. *)
2013-08-20 16:32:57 +02:00
val decompress_pdf : Pdf . t -> Pdf . t
2013-08-27 18:35:16 +02:00
(* * {2 Metadata and settings} *)
2013-08-28 17:31:38 +02:00
(* * [copy_id keepversion copyfrom copyto] copies the ID, if any, from
[ copyfrom ] to [ copyto ] . If [ keepversion ] is true , the PDF version of [ copyto ]
won't be affected . * )
2013-08-27 18:35:16 +02:00
val copy_id : bool -> Pdf . t -> Pdf . t -> Pdf . t
(* * [set_pdf_info ( key, value, version ) ] sets the entry [key] in the /Info directory, updating
2013-08-20 16:32:57 +02:00
the PDF minor version to [ version ] . * )
2019-07-01 15:40:22 +02:00
val set_pdf_info : ? xmp_also : bool -> ? xmp_just_set : bool -> ( string * Pdf . pdfobject * int ) -> Pdf . t -> Pdf . t
2013-08-20 16:32:57 +02:00
2019-07-03 15:40:32 +02:00
val get_xmp_info : Pdf . t -> string -> string
2013-08-27 18:35:16 +02:00
(* * [set_pdf_info ( key, value, version ) ] sets the entry [key] in the
2013-08-20 16:32:57 +02:00
/ ViewerPreferences directory , updating the PDF minor version to [ version ] . * )
val set_viewer_preference : ( string * Pdf . pdfobject * int ) -> Pdf . t -> Pdf . t
2013-08-27 18:35:16 +02:00
(* * Set the page layout to the given name ( sans slash ) e.g SinglePage *)
2013-08-20 16:32:57 +02:00
val set_page_layout : Pdf . t -> string -> Pdf . t
2013-08-27 18:35:16 +02:00
(* * Set the page layout to the given name ( sans slash ) e.g SinglePage *)
2013-08-20 16:32:57 +02:00
val set_page_mode : Pdf . t -> string -> Pdf . t
2013-10-02 16:29:53 +02:00
(* * Set the open action. If the boolean is true, /Fit will be used, otherwise /XYZ *)
val set_open_action : Pdf . t -> bool -> int -> Pdf . t
2013-08-28 17:31:38 +02:00
(* * Set the PDF version number *)
2013-08-27 18:35:16 +02:00
val set_version : int -> Pdf . t -> unit
2013-08-20 16:32:57 +02:00
2013-08-28 17:31:38 +02:00
(* * Given a PDF, returns a function which can lookup a given dictionary entry
from the / Info dictionary , returning it as a UTF8 string * )
2013-08-27 18:35:16 +02:00
val get_info_utf8 : Pdf . t -> string -> string
2013-08-20 16:32:57 +02:00
2013-08-28 17:31:38 +02:00
(* * Output to standard output general information about a PDF. *)
2013-08-27 18:35:16 +02:00
val output_info : encoding -> Pdf . t -> unit
2013-08-20 16:32:57 +02:00
2017-01-10 20:52:57 +01:00
(* * Output to standard output information from any XMP metadata stream in a PDF. *)
2014-10-14 15:42:52 +02:00
val output_xmp_info : encoding -> Pdf . t -> unit
2013-08-27 18:35:16 +02:00
(* * {2 Presentations} *)
2013-08-20 16:32:57 +02:00
2013-08-28 17:31:38 +02:00
(* * [presentation range t d horizontal inward direction effect_duration pdf]
adds a presentation on the pages in [ range ] . See cpdfmanual . pdf for details .
* )
2013-08-20 16:32:57 +02:00
val presentation : int list -> string option ->
float option -> bool -> bool -> int -> float -> Pdf . t -> Pdf . t
2013-08-27 18:35:16 +02:00
(* * {2 File Attachments} *)
2013-08-28 17:31:38 +02:00
(* * [attach_file keepversion topage pdf filename] attaches the file in [filename] to the pdf, optionally to a page ( rather than document-level ) . If keepversion is true, the PDF version number won't be altered. *)
2015-09-26 20:51:22 +02:00
val attach_file : ? memory : Pdfio . bytes -> bool -> int option -> Pdf . t -> string -> Pdf . t
2013-08-20 16:32:57 +02:00
2013-08-27 18:35:16 +02:00
(* * Remove attached files. *)
2013-08-20 16:32:57 +02:00
val remove_attached_files : Pdf . t -> Pdf . t
2015-09-26 21:30:57 +02:00
type attachment =
{ name : string ;
pagenumber : int ;
2015-09-27 20:10:06 +02:00
data : unit -> Pdfio . bytes }
2015-09-26 21:30:57 +02:00
2013-08-27 18:35:16 +02:00
(* * List attached files. Attachment name and page number. Page 0 is document level. *)
2015-09-26 21:30:57 +02:00
val list_attached_files : Pdf . t -> attachment list
2013-08-20 16:32:57 +02:00
2013-08-27 18:35:16 +02:00
(* * {2 Bookmarks} *)
2013-08-28 17:31:38 +02:00
(* * [parse_bookmark_file verify pdf input] parses the bookmark file in [input].
Details of the bookmark file format can be found in cpdfmanual . pdf * )
2013-08-20 16:32:57 +02:00
val parse_bookmark_file : bool -> Pdf . t -> Pdfio . input -> Pdfmarks . t list
2013-08-28 17:31:38 +02:00
(* * [add_bookmarks verify input pdf] adds bookmarks from the bookmark file
give . If [ verify ] is given , bookmarks will be verified to ensure , for example ,
that they are not out of the page range . * )
2013-08-20 16:32:57 +02:00
val add_bookmarks : bool -> Pdfio . input -> Pdf . t -> Pdf . t
2013-08-28 17:31:38 +02:00
(* * [list_bookmarks encoding range pdf output] lists the bookmarks to the given
output in the format specified in cpdfmanual . pdf * )
2013-08-27 18:35:16 +02:00
val list_bookmarks : encoding -> int list -> Pdf . t -> Pdfio . output -> unit
(* * {2 XML Metadata} *)
2013-08-20 16:32:57 +02:00
2013-08-28 17:31:38 +02:00
(* * [set_metadata keepversion filename pdf] sets the XML metadata of a PDF to the contents of [filename]. If [keepversion] is true, the PDF version will not be altered. *)
2013-08-20 16:32:57 +02:00
val set_metadata : bool -> string -> Pdf . t -> Pdf . t
2013-08-28 17:31:38 +02:00
(* * The same, but the content comes from [bytes]. *)
2013-08-20 16:32:57 +02:00
val set_metadata_from_bytes : bool -> Pdfio . bytes -> Pdf . t -> Pdf . t
2013-08-27 18:35:16 +02:00
(* * Remove the metadata from a file *)
2013-08-20 16:32:57 +02:00
val remove_metadata : Pdf . t -> Pdf . t
2013-08-28 17:31:38 +02:00
(* * Extract metadata to a [Pdfio.bytes] *)
2014-09-08 18:55:14 +02:00
val get_metadata : Pdf . t -> Pdfio . bytes option
2013-08-20 16:32:57 +02:00
2013-08-28 17:31:38 +02:00
(* * Print metadate to stdout *)
2013-08-27 18:35:16 +02:00
val print_metadata : Pdf . t -> unit
2013-08-20 16:32:57 +02:00
2019-07-01 15:40:22 +02:00
(* * Set the metadata date *)
val set_metadata_date : Pdf . t -> string -> Pdf . t
(* * Create XMP metadata from scratch *)
val create_metadata : Pdf . t -> Pdf . t
2019-06-29 16:03:22 +02:00
2013-08-27 18:35:16 +02:00
(* * {2 Stamping} *)
2013-08-20 16:32:57 +02:00
2013-08-28 17:54:23 +02:00
(* * [combine_pages fast under over scaletofit swap equalize] combines the page
content of two PDFs , page - by - page . If [ equalize ] is true the output will have
the same number of pages as the shorter file . If [ scaletofit ] is true , the
[ over ] file will be scaled to fit . If [ swap ] is true , [ over ] and [ under ] are
swapped . If [ fast ] is true , the PDFs are assumed to be well - formed and no
fixes are done . * )
2013-08-27 18:35:16 +02:00
val combine_pages : bool -> Pdf . t -> Pdf . t -> bool -> bool -> bool -> Pdf . t
2013-08-20 16:32:57 +02:00
2017-01-10 20:52:57 +01:00
(* * [stamp relative_to_cropbox position topline midline fast scale_to_fit isover range over pdf] stamps the first page of
2013-08-28 17:54:23 +02:00
[ over ] over each page of the PDF . The arguments have the same meaning as in
[ combine_pages ] . * )
2021-08-12 21:38:55 +02:00
val stamp : bool -> Cpdfposition . position -> bool -> bool -> bool -> bool -> bool -> int list -> Pdf . t -> Pdf . t -> Pdf . t
2013-08-27 18:35:16 +02:00
(* * {2 Splitting PDFs} *)
2013-08-20 16:32:57 +02:00
2013-08-29 12:54:56 +02:00
(* * Split a PDF on bookmarks of a given level or below. Level 0 is top level. *)
2013-08-20 16:32:57 +02:00
val split_on_bookmarks : Pdf . t -> int -> Pdf . t list
2013-08-27 18:35:16 +02:00
(* * {2 Listing fonts} *)
2013-08-20 16:32:57 +02:00
2013-08-27 18:35:16 +02:00
(* * Print font list to stdout *)
2013-08-20 16:32:57 +02:00
val print_fonts : Pdf . t -> unit
2013-08-28 17:31:38 +02:00
(* * Return font list. Page number, name, subtype, basefont, encoding. *)
2013-08-20 16:32:57 +02:00
val list_fonts : Pdf . t -> ( int * string * string * string * string ) list
2013-08-27 18:35:16 +02:00
(* * {2 Adding text} *)
(* * Expand the string "now" to a PDF date string, ignoring any other string *)
val expand_date : string -> string
2013-08-29 12:54:56 +02:00
(* * Justification of multiline text *)
2013-08-20 16:32:57 +02:00
type justification =
| LeftJustify
| CentreJustify
| RightJustify
2015-07-17 17:34:47 +02:00
(* * Call [add_texts metrics linewidth outline fast fontname font bates batespad colour
2013-08-29 12:54:56 +02:00
position linespacing fontsize underneath text pages orientation
2015-01-20 16:50:36 +01:00
relative_to_cropbox midline_adjust topline filename pdf ] . For details see cpdfmanual . pdf * )
2013-08-20 16:32:57 +02:00
val addtexts :
bool -> (* metrics *)
float -> (* linewidth *)
bool -> (* outline *)
bool -> (* fast *)
string -> (* fontname *)
Pdftext . standard_font option -> (* font *)
2015-04-13 15:42:18 +02:00
bool -> (* embed font *)
2015-07-17 17:34:47 +02:00
int -> (* bates number *)
int option -> (* bates padding width *)
2013-08-20 16:32:57 +02:00
float * float * float -> (* colour *)
2021-08-12 21:38:55 +02:00
Cpdfposition . position -> (* position *)
2013-08-20 16:32:57 +02:00
float -> (* linespacing *)
float -> (* fontsize *)
bool -> (* underneath *)
string -> (* text *)
int list -> (* page range *)
2021-08-12 21:38:55 +02:00
Cpdfposition . orientation -> (* orientation *)
2013-08-20 16:32:57 +02:00
bool -> (* relative to cropbox? *)
float -> (* opacity *)
justification -> (* justification *)
bool -> (* midline adjust? *)
2015-01-20 16:50:36 +01:00
bool -> (* topline adjust? *)
2013-08-20 16:32:57 +02:00
string -> (* filename *)
2016-11-13 15:02:09 +01:00
float option -> (* extract_text_font_size *)
2019-09-26 12:44:54 +02:00
string -> (* shift *)
2013-08-20 16:32:57 +02:00
Pdf . t -> (* pdf *)
Pdf . t
2013-08-29 12:54:56 +02:00
val metrics_howmany : unit -> int
val metrics_text : int -> string
val metrics_x : int -> float
val metrics_y : int -> float
val metrics_rot : int -> float
val metrics_baseline_adjustment : unit -> float
(* * These functions returns some details about the text if [addtexts] is called with [metrics] true. The integer arguments are 1 for the first one, 2 for the second etc. Call [metrics_howmany] first to find out how many. *)
2013-08-27 18:35:16 +02:00
(* * Remove text from the given pages. *)
2013-08-20 16:32:57 +02:00
val removetext : int list -> Pdf . t -> Pdf . t
2013-08-27 18:35:16 +02:00
(* * {2 Page geometry} *)
2013-08-20 16:32:57 +02:00
2013-08-29 12:54:56 +02:00
(* * Print page info ( Mediabox etc ) to standard output. *)
2014-08-11 15:05:07 +02:00
val output_page_info : Pdf . t -> int list -> unit
2013-08-27 18:35:16 +02:00
2013-08-29 12:54:56 +02:00
(* * True if a given page in a PDF has a given box *)
2013-08-27 18:35:16 +02:00
val hasbox : Pdf . t -> int -> string -> bool
2016-07-21 18:02:11 +02:00
(* * [crop_pdf xywhlist pdf range] sets the cropbox on the given pages. *)
2019-06-26 15:43:24 +02:00
val crop_pdf : ? box : string -> ( float * float * float * float ) list -> Pdf . t -> int list -> Pdf . t
2013-08-20 16:32:57 +02:00
2017-05-19 20:10:49 +02:00
val hard_box : Pdf . t -> int list -> string -> bool -> bool -> Pdf . t
2016-07-21 18:02:11 +02:00
(* * [set_mediabox xywhlist pdf range] sets the media box on the given pages. *)
val set_mediabox : ( float * float * float * float ) list -> Pdf . t -> int list -> Pdf . t
2013-08-20 16:32:57 +02:00
2019-08-08 17:57:25 +02:00
(* * [setBox boxname x y w h pdf range] sets the given box on the given pages. *)
val setBox : string -> float -> float -> float -> float -> Pdf . t -> int list -> Pdf . t
2013-08-20 16:32:57 +02:00
2013-08-27 18:35:16 +02:00
(* * Remove any cropping from the given pages. *)
2013-08-20 16:32:57 +02:00
val remove_cropping_pdf : Pdf . t -> int list -> Pdf . t
2013-08-29 12:54:56 +02:00
(* * Remove any trim box from the given pages. *)
2013-08-20 16:32:57 +02:00
val remove_trim_pdf : Pdf . t -> int list -> Pdf . t
2013-08-29 12:54:56 +02:00
(* * Remove any bleed box from the given pages. *)
2013-08-20 16:32:57 +02:00
val remove_bleed_pdf : Pdf . t -> int list -> Pdf . t
2013-08-29 12:54:56 +02:00
(* * Remove any art box from the given pages. *)
2013-08-20 16:32:57 +02:00
val remove_art_pdf : Pdf . t -> int list -> Pdf . t
2013-08-27 18:35:16 +02:00
(* * Change rotation to a given value 0, 90, 180, 270 on given pages. *)
2013-08-20 16:32:57 +02:00
val rotate_pdf : int -> Pdf . t -> int list -> Pdf . t
2013-08-27 18:35:16 +02:00
(* * Rotate clockwise by 0, 90, 180, 270 on given pages. *)
2013-08-20 16:32:57 +02:00
val rotate_pdf_by : int -> Pdf . t -> int list -> Pdf . t
2013-08-29 12:54:56 +02:00
(* * Rotate the contents by the given angle on the given pages. If [fast] is true, assume PDF is well-formed. *)
2013-08-20 16:32:57 +02:00
val rotate_contents : ? fast : bool -> float -> Pdf . t -> int list -> Pdf . t
2013-08-27 18:35:16 +02:00
(* * Modify the rotation of the page and its contents to leave the rotation at 0 with the page effectively unaltered. *)
val upright : ? fast : bool -> int list -> Pdf . t -> Pdf . t
(* * Flip the given pages vertically *)
2013-08-20 16:32:57 +02:00
val vflip_pdf : ? fast : bool -> Pdf . t -> int list -> Pdf . t
2013-08-27 18:35:16 +02:00
(* * Flip the given pages horizontally *)
2013-08-20 16:32:57 +02:00
val hflip_pdf : ? fast : bool -> Pdf . t -> int list -> Pdf . t
2016-07-21 18:02:11 +02:00
(* * 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
2013-08-20 16:32:57 +02:00
2016-07-21 18:02:11 +02:00
(* * Scale a PDF in sx, sy in the given pages. List of ( sx, sy ) pairs is
for all pages in pdf . * )
val scale_pdf : ? fast : bool -> ( float * float ) list -> Pdf . t -> int list -> Pdf . t
2013-08-20 16:32:57 +02:00
2019-03-19 15:03:28 +01:00
(* * [scale_to_fit_pdf fast position input_scale x y op pdf range] scales a page to fit the
2013-08-29 12:54:56 +02:00
page size given by ( x , y ) and by the [ input_scale ] ( e . g 1 . 0 = scale to fit , 0 . 9
= scale to fit leaving a border etc . ) . [ op ] is unused . * )
2021-08-12 21:38:55 +02:00
val scale_to_fit_pdf : ? fast : bool -> Cpdfposition . position -> float -> ( float * float ) list -> ' a -> Pdf . t -> int list -> Pdf . t
2013-08-20 16:32:57 +02:00
2013-08-27 18:35:16 +02:00
(* * Scale the contents of a page by a given factor centred around a given point in a given range. *)
2021-08-12 21:38:55 +02:00
val scale_contents : ? fast : bool -> Cpdfposition . position -> float -> Pdf . t -> int list -> Pdf . t
2013-08-20 16:32:57 +02:00
2020-11-12 16:16:58 +01:00
val trim_marks : ? fast : bool -> Pdf . t -> int list -> Pdf . t
val show_boxes : ? fast : bool -> Pdf . t -> int list -> Pdf . t
2013-08-27 18:35:16 +02:00
(* * {2 Padding} *)
(* * Put blank pages before the given page numbers *)
2017-12-18 20:44:02 +01:00
val padbefore : ? padwith : Pdf . t -> int list -> Pdf . t -> Pdf . t
2013-08-20 16:32:57 +02:00
2013-08-27 18:35:16 +02:00
(* * Put blank pages after the given page numbers *)
2017-12-18 20:44:02 +01:00
val padafter : ? padwith : Pdf . t -> int list -> Pdf . t -> Pdf . t
2013-08-20 16:32:57 +02:00
2013-08-27 18:35:16 +02:00
(* * Pad to a multiple of n pages *)
2013-08-20 16:32:57 +02:00
val padmultiple : int -> Pdf . t -> Pdf . t
2013-08-27 18:35:16 +02:00
(* * {2 Annotations} *)
2013-08-28 17:31:38 +02:00
(* * List the annotations to standard output in a given encoding. See cpdfmanual.pdf for the format details. *)
2013-08-20 16:32:57 +02:00
val list_annotations : encoding -> Pdf . t -> unit
2013-08-28 17:31:38 +02:00
(* * The same, but giving more information. Deprecated *)
2013-08-20 16:32:57 +02:00
val list_annotations_more : Pdf . t -> unit
2013-08-28 17:31:38 +02:00
(* * Return the annotations as a ( pagenumber, content ) list *)
2013-08-20 16:32:57 +02:00
val get_annotations : encoding -> Pdf . t -> ( int * string ) list
2013-08-28 17:31:38 +02:00
(* * Copy the annotations on a given set of pages from a to b. b is returned. *)
2013-08-20 16:32:57 +02:00
val copy_annotations : int list -> Pdf . t -> Pdf . t -> Pdf . t
2013-08-27 18:35:16 +02:00
(* * Remove the annotations on given pages. *)
2013-08-20 16:32:57 +02:00
val remove_annotations : int list -> Pdf . t -> Pdf . t
2013-08-27 18:35:16 +02:00
(* * {2 Imposition} *)
2013-08-28 17:31:38 +02:00
(* * The twoup_stack operation puts two logical pages on each physical page,
2019-07-08 16:13:34 +02:00
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
2013-08-20 16:32:57 +02:00
2013-08-28 17:31:38 +02:00
(* * The twoup operation does the same, but scales the new sides down so that
2019-07-08 16:13:34 +02:00
the media box is unchanged . Bool true ( fast ) if assume well - formed ISO content streams . * )
val twoup : bool -> Pdf . t -> Pdf . t
2013-08-28 17:31:38 +02:00
2013-08-27 18:35:16 +02:00
(* * {2 Making new documents} *)
2013-08-20 16:32:57 +02:00
2013-08-28 17:31:38 +02:00
(* * Make a blank document given x and y page dimensions in points and a number of pages *)
2013-08-27 18:35:16 +02:00
val blank_document : float -> float -> int -> Pdf . t
2013-08-20 16:32:57 +02:00
2013-08-28 17:31:38 +02:00
(* * The same, but give a Pdfpaper.t paper size. *)
2013-08-27 18:35:16 +02:00
val blank_document_paper : Pdfpaper . t -> int -> Pdf . t
2013-08-20 16:32:57 +02:00
2013-10-24 16:21:54 +02:00
(* * {2 Page labels} *)
(* * Add page labels. *)
2014-09-18 15:27:07 +02:00
val add_page_labels :
2020-01-25 08:22:45 +01:00
Pdf . t -> bool -> Pdfpagelabels . labelstyle -> string option -> int -> int list -> unit
2013-10-24 16:21:54 +02:00
2013-08-27 18:35:16 +02:00
(* * {2 Miscellany} *)
(* * Make all lines in the PDF at least a certain thickness. *)
2013-08-20 16:32:57 +02:00
val thinlines : int list -> float -> Pdf . t -> Pdf . t
2013-08-27 18:35:16 +02:00
(* * Make all text on certain pages black. *)
2016-11-09 19:15:23 +01:00
val blacktext : float * float * float -> int list -> Pdf . t -> Pdf . t
2013-08-20 16:32:57 +02:00
2013-08-27 18:35:16 +02:00
(* * Make all lines on certain pages black. *)
2016-11-09 19:15:23 +01:00
val blacklines : float * float * float -> int list -> Pdf . t -> Pdf . t
2013-08-20 16:32:57 +02:00
2013-08-27 18:35:16 +02:00
(* * Make all fills on certain pages black. *)
2016-11-09 19:15:23 +01:00
val blackfills : float * float * float -> int list -> Pdf . t -> Pdf . t
2013-08-20 16:32:57 +02:00
2013-08-27 18:35:16 +02:00
(* * Remove images from a PDF, optionally adding crossed boxes. *)
2019-07-09 17:31:45 +02:00
val draft : string option -> bool -> int list -> Pdf . t -> Pdf . t
2013-08-20 16:32:57 +02:00
2014-09-30 18:43:04 +02:00
(* * Squeeze a PDF *)
2020-05-06 18:00:55 +02:00
val squeeze : ? logto : string -> ? pagedata : bool -> ? recompress : bool -> Pdf . t -> unit
2014-09-30 18:43:04 +02:00
2020-11-14 17:40:01 +01:00
val remove_all_text : int list -> Pdf . t -> Pdf . t
2013-08-27 18:35:16 +02:00
(* * / * *)
2013-08-20 16:32:57 +02:00
2017-01-10 20:52:57 +01:00
val process_xobjects : Pdf . t -> Pdfpage . t -> ( Pdf . t -> Pdf . pdfobject -> Pdf . pdfobject list -> Pdf . pdfobject list ) -> unit
2013-08-27 18:35:16 +02:00
(* * Custom CSP1 *)
val custom_csp1 : Pdf . t -> Pdf . t
2013-08-20 16:32:57 +02:00
2013-08-27 18:35:16 +02:00
(* * Custom CSP2 *)
val custom_csp2 : float -> Pdf . t -> Pdf . t
2013-08-20 16:32:57 +02:00
2013-08-27 18:35:16 +02:00
(* * Nobble a page, given pdf, pagenumber and page *)
val nobble_page : Pdf . t -> ' a -> Pdfpage . t -> Pdfpage . t
2013-08-20 16:32:57 +02:00
2014-11-24 13:02:36 +01:00
val find_cpdflin : string option -> string
2014-10-02 14:48:45 +02:00
val call_cpdflin : string -> string -> string -> string -> int
2014-11-24 15:31:38 +01:00
val debug : bool ref
2016-11-13 15:02:09 +01:00
val extract_text : float option -> Pdf . t -> int list -> string
2019-10-02 14:41:56 +02:00
val append_page_content : string -> bool -> bool -> int list -> Pdf . t -> Pdf . t
2020-02-27 15:14:51 +01:00
val ocg_coalesce : Pdf . t -> unit
2021-06-08 17:58:35 +02:00
val ocg_get_list : Pdf . t -> string list
2020-02-27 15:14:51 +01:00
val ocg_list : Pdf . t -> unit
val ocg_rename : string -> string -> Pdf . t -> unit
2020-03-02 13:37:39 +01:00
val ocg_order_all : Pdf . t -> unit
2020-03-19 17:23:16 +01:00
val stamp_as_xobject : Pdf . t -> int list -> Pdf . t -> Pdf . t * string
2020-03-18 18:08:30 +01:00
2020-11-14 17:40:01 +01:00
val remove_dict_entry : Pdf . t -> string -> unit
val remove_clipping : Pdf . t -> int list -> Pdf . t
2020-11-25 17:54:15 +01:00
val image_resolution : Pdf . t -> int list -> float -> ( int * string * int * int * float * float ) list