Index of values

( *.= ) [Pdfutil]

Operations on floating point references

( *= ) [Pdfutil]

Operations on integer references

(+.=) [Pdfutil]
(+=) [Pdfutil]
(-.=) [Pdfutil]
(-=) [Pdfutil]
(/.=) [Pdfutil]
(/=) [Pdfutil]
(<|) [Pdfutil]

This is equivalent to let ( <| ) a b = a b

(=@) [Pdfutil]

Append something to the front of the contents of a list reference.

(=|) [Pdfutil]

Cons something onto the contents of a list reference.

(@) [Pdfutil]
(@@) [Pdfutil]

Append with reversed arguments.

(|&|) [Pdfutil]

Exclusive OR

a0 [Pdfpaper]
a1 [Pdfpaper]
a10 [Pdfpaper]

ISO A series paper sizes, portrait.

a2 [Pdfpaper]
a3 [Pdfpaper]
a4 [Pdfpaper]
a5 [Pdfpaper]
a6 [Pdfpaper]
a7 [Pdfpaper]
a8 [Pdfpaper]
a9 [Pdfpaper]
add [Pdfutil]

add k v l Adds (k, v) to a dictionary, replacing any existing binding of k.

add_annotation [Pdfannot]

Add an annotation to a page in a document.

add_bookmarks [Pdfmarks]

Add bookmarks to a document, replacing any currently there.

add_dict_entry [Pdf]

add_dict_entry dict key value adds a dictionary entry, replacing if already there.

add_label [Pdfpagelabels]

Add a range starting at pagelabel.startpage, ending at the integer page given.

add_pagetree [Pdfpage]

Build a page tree from a list of pages and install it in the given PDF document.

add_prefix [Pdfpage]

For every page in the PDF, add the prefix to any name in /Resources and add the prefix to any name used in any content streams.

add_root [Pdfpage]

Given the page root number (for instance that returned by add_pagetree), any specific extra dictionary entries and a PDF document, build a document root.

addobj [Pdf]

Add an object.

addobj_given_num [Pdf]

Same as addobj, but pick a number ourselves.

aes_decrypt_data [Pdfcryptprimitives]

aes_decrypt_data nk key data decrypts AES data for the given key length, key, and data.

aes_decrypt_data_ecb [Pdfcryptprimitives]

As aes_decrypt_data above, but in ECB instead of CBC mode

aes_encrypt_data [Pdfcryptprimitives]

aes_encrypt_data nk key data encryptes with AES, given a key length, key and data.

aes_encrypt_data_ecb [Pdfcryptprimitives]

As aes_encrypt_data, but in ECB instead of CBC mode

afm_data [Pdfstandard14]

The data extracted from the font AFM.

align [Pdfio]

Align the bitstream on a byte boundary

align_write [Pdfio]


all_but_last [Pdfutil]

Produce a list containing all but the last element of a list.

always [Pdfutil]

The always-true predicate.

annotations_of_page [Pdfannot]

Return the annotations on a page in a document.

append [Pdftransform]

append a b is a transform with the same effect as performing b then a

append [Pdfutil]
applyn [Pdfutil]

Apply a function f n times to initial argument arg.

array_iter2 [Pdfutil]

iter2 on arrays.

array_map2 [Pdfutil]

map2 on arrays.

baseline_adjustment [Pdfstandard14]

The appropriate amount to subtract from the y-coordinate of a 1pt text line to place it vertically centered around the y coordinate, rather than with the baseline at that y coordinate.

between [Pdfutil]

Find the point equidistant between two others.

bget [Pdfio]

Get the value at a position in a bytes

bget_unsafe [Pdfio]

Like bget, but with no range checking

bigarray_of_stream [Pdf]

Fetch a stream, if necessary, and return its contents (with no processing).

bitbytes_of_input [Pdfio]

Make a bitstream from an input.

bitstream_pos [Pdfio]

Get the current position.

bitstream_seek [Pdfio]

Seek to a position within a bitstream

blankpage [Pdfpage]

Create a page with empty content, media box from the given paper size, empty resources, zero rotation and no extra dictionary entries.

box_overlap [Pdfutil]

The intersection box (if any) of two integer boxes, each defined as xmin ymin xmax ymax.

box_overlap_float [Pdfutil]

The intersection box (if any) of two floating-point boxes, each defined as xmin ymin xmax ymax.

box_union [Pdfutil]

The smallest box enclosing both given integer boxes.

box_union_float [Pdfutil]

The smallest box enclosing both given floating-point boxes.

bpc [Pdfimage]

Given a PDF and an image, return any /BPC entry

bset [Pdfio]

bset s n v sets the value n at position v in bytes

bset_unsafe [Pdfio]

Like bset but with no range checking

bytes_of_arraylist [Pdfio]

Make bytes from a list of integer arrays.

bytes_of_caml_bytes [Pdfio]

Make bytes from ocaml bytes.

bytes_of_charlist [Pdfio]

Make bytes from a character list.

bytes_of_input [Pdfio]

bytes_of_input i o l gives a bytes with s o...o + l - 1 from the input

bytes_of_input_channel [Pdfio]

Extract a bytes from an input or output.

bytes_of_int_array [Pdfio]

Make bytes from an integer array

bytes_of_list [Pdfio]

Make bytes from a list of integers, each between 0 and 255.

bytes_of_string [Pdfio]

Make bytes from a string.

bytes_of_write_bitstream [Pdfio]

Build bytes from a write bitstream, padding the with zero-valued bits.

bytes_selfmap [Pdfio]

Map bytes onto itself using a function on each byte

bytes_size [Pdfio]

Size of bytes.

bytes_to_output_channel [Pdfio]

Write a bytes to an output channel

catalog_of_pdf [Pdf]

Return the document catalog.

centimetres [Pdfunits]

Convert a measurement to centimetres

change_id [Pdf]

Change the /ID string in a PDF's trailer dicfionary

change_pages [Pdfpage]

Change the pages in a document for some new ones.

changes [Pdf]

Calculate the changes required to renumber a PDF's objects 1..n.

charcode_extractor_of_font [Pdftext]

Return the character code for a given unicode codepoint, if it exists in the encoding and font object.

charcode_extractor_of_font_real [Pdftext]

Return the character code for a given unicode codepoint, if it exists in the encoding and font.

charlist_of_bytes [Pdfio]

Make a character list from a bytes

clear [Pdfutil]

Set a boolean reference to false

cleave [Pdfutil]

cleave l n splits l into two parts, returned as a tuple.

cleavewhile [Pdfutil]

Same, but split point controlled by a predicate, which is true for elements in the first returned list.

cleavewhile_unordered [Pdfutil]

The same as cleavewhile, but the output lists are each unordered.

coalesce [Pdfpagelabels]

Optimise page labels, removing any which are not required.

codepoints_of_pdfdocstring [Pdftext]

Produce a list of unicode codepoints from a pdfdocencoding or UTF16BE pdf document string

codepoints_of_text [Pdftext]

Return a list of unicode points from a given extractor and string (for example from a Pdfpages.Op_Tj or Op_TJ operator).

codepoints_of_utf16be [Pdftext]

A list of unicode codepoints for a UTF16BE string

codepoints_of_utf8 [Pdftext]

A list of unicode codepoints for a UTF8 string

collate [Pdfutil]

Collate a list into a list of lists based upon a comparison function by which it has already been sorted.

colspace [Pdfimage]

Given a PDF, an image and a /Resources dictionary, return the colourspace of the image

combine [Pdfutil]
combine3 [Pdfutil]
compare_i [Pdfutil]

Monomorphic integer version of

complete [Pdfpagelabels]

Return a list where every page has a label - pages which don't are given arabic page numbers

components [Pdfops]

Given a pdf, a resources dictionary and a colourspace dictionary, give the number of bytes per pixel in the stored image data.

compose [Pdftransform]

compose t ts adds operation t to the transform ts.

compress [Pdfflate]

Compress data.

concat_bytess [Pdfops]

Concatenate a list bytes, padding with whitespace between.

conspair [Pdfutil]

Consing to each of a pair of lists at the same time.

conspairopt [Pdfutil]

Version of conspair where there may or may not be somthing to cons in each case.

contents_of_file [Pdfutil]

Return the contents of a (binary) file as a string

contents_of_nametree [Pdf]

Return an ordered list of the key-value pairs in a given name tree.

copybytes [Pdfio]

Copy bytes.

couple [Pdfutil]

Couple the elements of a list l using given function.

couple_ext [Pdfutil]

As couple, but an extra unary function is applied to any last (odd) element.

couple_reduce [Pdfutil]

Apply couple repeatedly until only one element remains.

courier_afm [Pdfafmdata]
courier_bold_afm [Pdfafmdata]
courier_bold_oblique_afm [Pdfafmdata]
courier_oblique_afm [Pdfafmdata]
crypt [Pdfcryptprimitives]

ARC4 encryption (40 bit and 128 bit) given a key and some data

crypt_debug [Pdfcrypt]

If this is set, various debug is produced on standard output.

cumulative_sum [Pdfutil]

Cumulative sum of a list given an initial value.

custompage [Pdfpage]

The same, but given a page size rectangle.

date_of_string [Pdfdate]

Build a date by parsing a PDF date string.

debug [Pdfops]

When this reference is set, some debug information is printed to Standard Output.

debug [Pdfcodec]

Setting this boolean prints some debug information.

debug_always_treat_malformed [Pdfread]

If set, we always use the malformed PDF reader.

debug_next_n_chars [Pdfio]

Debug the next n chars to standard output and then rewind back

debug_whole_pdf [Pdfwrite]

For debug, print out the PDFs objects to standard output.

decode_flate [Pdfcodec]

Decode data in FlateDecode.

decode_from_input [Pdfcodec]

Given a Pdfio.input with pointer at the first byte and an inline image stream dictionary, decode the first decoder and its predictor.

decode_pdfstream [Pdfcodec]

Given a document and stream, decode.

decode_pdfstream_onestage [Pdfcodec]

Given a document and stream decode just one stage.

decode_pdfstream_until_unknown [Pdfcodec]

Given a document and stream decode until there's an unknown decoder.

decompose [Pdftransform]

Decompose a transformation matrix to scale, aspect, rotation, shear, translation in x, translation in y.

decrypt_pdf [Pdfcrypt]

Decrypt a PDF document, given the user password, returning the permissions under which the document was encrypted.

decrypt_pdf_owner [Pdfcrypt]

Decrypt a PDF document, given the owner password.

decrypt_stream_data [Pdfcryptprimitives]

Calling decrypt_stream_data crypt_type encrypt file_encryption_key obj gen key keylength r data decrypts data.

deep_copy [Pdf]

Copy a PDF data structure so that nothing is shared with the original.

default [Pdfe]

Default error logger, writes the string to stderr and flushes.

deg_of_rad [Pdfutil]

Convert between radians and degrees.

direct [Pdf]

Make a PDF object direct -- that is, follow any indirect links.

distance_between [Pdfutil]

Cartesian distance between two points.

do_many [Pdfutil]

do_many f n calls f () n times.

do_return [Pdfutil]

do_return f g Evaluate f (), evaluate and ignore g (), return f (), in that order.

drop [Pdfutil]

drop l n drops n elements from the list raising Invalid_argument if n < 0 or there are not enough elements.

drop' [Pdfutil]

Same as drop, but with the arguments reversed.

drop_evens [Pdfutil]

Remove the second, fourth etc.

drop_odds [Pdfutil]

Remove the first, third etc.

dropwhile [Pdfutil]

Drop elements from a list while a given predicate is true.

dropwhite [Pdfread]

Drop whitespace characters from an input.

empty [Pdf]

The empty document (PDF 1.0, no objects, no root, empty trailer dictionary).

encode_flate [Pdfcodec]

Encode data in FlateDecode.

encode_pdfstream [Pdfcodec]

Encode a PDF stream with an encoding.

encrypt_pdf_128bit [Pdfcrypt]

Ditto for 128 bit encryption

encrypt_pdf_40bit [Pdfcrypt]

Encrypt a PDF documnent, using 40 bit encryption, with given user and owner passwords.

encrypt_pdf_AES [Pdfcrypt]

Encrypt a file using the AESV2 Crypt filter

encrypt_pdf_AES256 [Pdfcrypt]

Encrypt a file using the AESV3 Crypt filter

encrypt_pdf_AES256ISO [Pdfcrypt]

Encrypt a file using the AESV4 (ISO) Crypt filter

endpage [Pdfpage]

Number of pages in a document, faster than reading the pages and counting.

eq [Pdfutil]


error_on_malformed [Pdfread]

If set, a malformed PDF will cause an error, not an attempt to read using the malformed PDF reader.

eval_function [Pdffun]

Evaluate a function given a list of inputs.

even [Pdfutil]
explode [Pdfutil]

List of characters representing a string.

extract_bytes_from_input_output [Pdfio]

Extract the contents of an input-output in bytes

extremes [Pdfutil]

Find the first and last element of a list.

extremes_and_middle [Pdfutil]

Return the first, middle and last elements of a list which has length at least two.

fabs [Pdfutil]

Monomorphic floating-point versions of Stdlib functions

fillbytes [Pdfio]

Fill bytes with a value

find_hash [Pdfcryptprimitives]

Given an object number, generation number, input key and key length in bits, apply Algorithm 3.1 from the PDF Reference manual to obtain the hash to be used by the encryption function.

find_indirect [Pdf]

Find the indirect reference given by the value associated with a key in a dictionary.

firstchar [Pdfutil]

Return the first character of a string, should it have one.

flags_of_standard_font [Pdfstandard14]

Return a suitable flags value for a standard font

flate_level [Pdfcodec]

Setting this changes globally the FlateDecode compression level.

flatten [Pdfutil]
fleprint [Pdfutil]

Print a string to standard error and flush.

flip [Pdfutil]

Flip a boolean reference

flprint [Pdfutil]

Print a string to standard output and flush.

fmax [Pdfutil]
fmin [Pdfutil]
fold_left [Pdfutil]
fold_right [Pdfutil]
fsum [Pdfutil]

Sum of a list of floats.

generate_id [Pdf]

Generate and ID for a PDF document given its prospective file name (and using the current date and time).

get_image [Pdfimage]

Similarly, but if it's to be Raw, use the smallest pixel layout required to represent the data.

get_image_24bpp [Pdfimage]

Given a pdf document, resources dictionary and a stream representing an image, return a triple : width, height, and a stream of (width * height * 3) bytes RGBRGB etc.

get_image_raw [Pdfimage]

Get the uncompressed image contents, decoding JPEG, JPEG2000 and JBIG2 as required.

get_image_raw_24bpp [Pdfimage]

Get the uncompressed image contents in 24bpp, decoding JPEG, JPEG2000 and JBIG2 as required.

get_image_unprocessed_pixel [Pdfimage]

Return a function which, when given an x and y coordinate, returns the pixel byte values prior to any decoding, i.e in the raw input image data before /Decode, /Index lookups and so on.

get_jpeg_data [Pdfjpeg]

Return the JPEG data starting at the current position in the Pdfio.input, leaving the input ready to read the first byte following the JPEG data.

getbit [Pdfio]

Get a bit

getbitint [Pdfio]

Get a bit, but as an integer, 0 or 1.

getinit [Pdfio]

getinit f s o l calls f on each s within o...l - 1

getnum [Pdf]

Return a float from a Real, an Int or an Indirect

getstream [Pdf]

Get a stream from disc if it hasn't already been got.

getuntil [Pdfread]

Read characters until a predicate is true.

getuntil_white_or_delimiter [Pdfread]
getuntil_white_or_delimiter_string [Pdfread]
getval_31 [Pdfio]

Get up to 31 bits as a native integer

getval_32 [Pdfio]

Get up to 32 bits as a 32 bit value

glyph_hashes [Pdfglyphlist]

The Adobe Glyph List, which maps character names to sequences of unicode codepoints.

glyphnames_of_text [Pdftext]

Return a list of glyph names from a given extractor and string

hashset_of_list [Pdfutil]
hashtable_of_dictionary [Pdfutil]

Build a hashtable from a dictionary (list of key-value pairs).

hd [Pdfutil]
heads [Pdfutil]

Return a list of the heads of a list of lists, each of which has at least one element, preserving order.

height [Pdfpaper]

Project the height from a paper size.

helvetica_afm [Pdfafmdata]
helvetica_bold_afm [Pdfafmdata]
helvetica_bold_oblique_afm [Pdfafmdata]
helvetica_oblique_afm [Pdfafmdata]
i [Pdftransform]

The identity transform

i32add [Pdfutil]
i32div [Pdfutil]
i32max [Pdfutil]
i32min [Pdfutil]
i32mul [Pdfutil]
i32ofi [Pdfutil]
i32ofi64 [Pdfutil]
i32pred [Pdfutil]
i32sub [Pdfutil]
i32succ [Pdfutil]
i32tof [Pdfutil]
i32toi [Pdfutil]
i64add [Pdfutil]
i64div [Pdfutil]
i64max [Pdfutil]
i64min [Pdfutil]
i64mul [Pdfutil]
i64ofi [Pdfutil]
i64ofi32 [Pdfutil]

Shortened names for functions from Int32 and Int64.

i64pred [Pdfutil]
i64sub [Pdfutil]
i64succ [Pdfutil]
i64tof [Pdfutil]
i64toi [Pdfutil]
i_matrix [Pdftransform]

The identity matrix

ident [Pdfutil]

The identity function.

ignoreuntil [Pdfread]

Throw away characters until a predicate is true.

ilist [Pdfutil]

ilist 2 5 returns [2; 3; 4; 5].

ilist_fail_null [Pdfutil]

Same as ilist_null, but return empty list if start > end, instead of failing

ilist_null [Pdfutil]

Same as ilist, but return the empty list for ilist x x rather than [x]

implode [Pdfutil]

String representing a list of characters.

inches [Pdfunits]

Convert a measurement to inches

index [Pdfutil]

Find the position of the first element matching a predicate.

indirect_number [Pdf]

Return the object number of an indirect dictionary object, if it is indirect.

indx [Pdfutil]

indx l returns [1; 2; 3] if l has length 3, for example.

indx0 [Pdfutil]

Same as indx, but 0-based.

indxn [Pdfutil]

Same as indx, but n-based.

input_of_bytes [Pdfio]

Make an input from a bytes.

input_of_channel [Pdfio]

Make an input from an OCaml input channel.

input_of_string [Pdfio]

Make an input from a string.

input_output_of_bytes [Pdfio]

Build an input-ouput, with an initial buffer size.

input_pdferror [Pdf]

This function, given a Pdfio.input and an ancilliary string, builds an error string which includes the source of the Pdfio.input (filename, string, bytes etc) so we can trace what it was originally built from

int_array_of_bytes [Pdfio]

An integer array of bytes from bytes

int_array_of_string [Pdfio]

Integer array from a string

int_of_rotation [Pdfpage]

Utility function to convert from rotation to integers.

interleave [Pdfutil]

Interleave an element among a list, so that interleave 0 [1; 2; 3] yields [1; 0; 2; 0; 3].

interleave_lists [Pdfutil]

Interleave two equal-length lists, taking from the first list first.

invert [Pdfutil]

Invert a vector.

iround [Pdfutil]

The same, returning an integer.

is_delimiter [Pdf]

True if a character is a PDF delimiter.

is_encrypted [Pdfcrypt]

Is a PDF encrypted?

is_identity_h [Pdftext]

Is a font Identity H?

is_linearized [Pdfread]

Given a filename, see if the file is linearized.

is_not_whitespace [Pdf]

True if a character is not PDF whitespace.

is_unicode [Pdftext]

Is a PDF string UTF16be (i.e does it have a byte order marker at the beginning)?

is_whitespace [Pdf]

True if a character is PDF whitespace.

isdigit [Pdfutil]

A character is a decimal digit.

isnull [Pdfutil]
isolate [Pdfutil]

isolate p p' l isolate a central section of a list l, from the first element after the elements for which predicate p is true, to the element before p' is first true.

iter [Pdfutil]
iter2 [Pdfutil]
iter3 [Pdfutil]
iter_stream [Pdf]

Iterate over just the stream objects in a document.

keep [Pdfutil]
land32 [Pdfutil]
land64 [Pdfutil]
landscape [Pdfpaper]

Flip a paper size between landscape and portrait, swapping its dimensions.

largest_pow2_divisible [Pdfutil]

The largest power of two by which a number is exactly divisible.

last [Pdfutil]

Find the last element of a list.

lastchar [Pdfutil]

Return the first character of a string, should it have one.

lcount [Pdfutil]

Count the number of elements in a list for which predicate is true.

leafnames_of_dir [Pdfutil]

Return a list of leafnames for the given folder in the current folder

length [Pdfutil]
lex [Pdfgenlex]

Lex all the token in a Pdfio.input.

lex_comment [Pdfread]

Lex a comment, assuming there is one to lex.

lex_dictionary [Pdfread]

Lex a dictinonary, assuming there is one to lex.

lex_hexstring [Pdfread]

Lex a hexadecimal string, assuming there is one to lex.

lex_name [Pdfread]

Lex a name, assuming there is one to lex.

lex_number [Pdfread]

Lex a number, assuming there is one to lex.

lex_single [Pdfgenlex]

Lex a single token from a Pdfio.input.

lex_stream_data [Pdfread]

Lex stream data of the given length.

lex_string [Pdfread]

Lex a string, assuming there is one to lex.

lex_string [Pdfgenlex]

Lex all the tokens from a string.

list_of_hashtbl [Pdfutil]

Make a list of key-value pairs reflecting the contents of a hash table.

lnot32 [Pdfutil]
lnot64 [Pdfutil]
log [Pdfe]

Log a string.

log2of [Pdfutil]

Base two logarithm

logger [Pdfe]

The current error logger, set to default upon startup.

lookup [Pdfutil]

lookup x l looks up something, returning None if not found.

lookup_direct [Pdf]

lookup_direct doc key dict looks up the key returning an option type.

lookup_direct_orelse [Pdf]

Same as lookup_direct, but allow a second, alternative key.

lookup_exception [Pdf]

Same, but with customised exception.

lookup_fail [Pdf]

lookup_fail errtext doc key dict looks up a key in a PDF dictionary or the dictionary of a PDF stream.

lookup_failnull [Pdfutil]

Same as lookup, but no option type.

lookup_obj [Pdf]

Lookup an object in a document, parsing it if required.

lor32 [Pdfutil]
lor64 [Pdfutil]
lose [Pdfutil]

List.filter has a confusing name, so we define keep and lose to avoid error.

losenones [Pdfutil]

Return just the non-None elements of an 'a option list

lsl32 [Pdfutil]
lsl64 [Pdfutil]
lsr32 [Pdfutil]
lsr64 [Pdfutil]
lxor32 [Pdfutil]
lxor64 [Pdfutil]
make [Pdfannot]

Make an annotation of a given subtype.

make [Pdfpaper]

Make a paper size given its unit, width and height.

make_border [Pdfannot]

Make a border.

make_hex_pdf_string [Pdfwrite]

Convert a PDF string to Hex PDF string representation

make_matrix [Pdf]

Build a matrix pdfobject.

make_write_bitstream [Pdfio]

Return a new write bistream.

many [Pdfutil]

many x n makes a list of length n with each element equal to x.

manyunique [Pdfutil]

A version where we need to apply unit each time, for instance when producing a list of random numbers.

map [Pdfutil]
map2 [Pdfutil]
map3 [Pdfutil]

Similar to map2, but 3 arguments.

map4 [Pdfutil]

Similar to map2, but 4 arguments.

map5 [Pdfutil]

Similar to map2, but 5 arguments.

map6 [Pdfutil]

Similar to map2, but 6 arguments.

map_lol [Pdfutil]

Map on lists of lists.

matrix_compose [Pdftransform]

compose a b produces a matrix equivalent to performing b then a.

matrix_invert [Pdftransform]

Matrix inversion.

matrix_of_op [Pdftransform]

Make a matrix from a single transformation operation

matrix_of_transform [Pdftransform]

Make a matrix from a transform

max [Pdfutil]

Monomorphic integer versions of Stdlib functions.

mem [Pdfutil]

Synonym for List.mem.

mem' [Pdfutil]

List.mem with arguments reversed.

memoize [Pdfutil]

memoize f builds a memoized version of the function f.

merge_pagelabels [Pdfpagelabels]

Merge some page labels for some PDFs and page ranges.

merge_pdfs [Pdfmerge]

Merge PDF files.

mergedict [Pdfutil]

Merge two lists, preferring elements in the second in the case of clashes.

millimetres [Pdfunits]

Convert a measurement to millimetres

min [Pdfutil]
minimum_valid_pdf [Pdfpage]

Generate a PDF file with a single A4 page.

mkbytes [Pdfio]

Make bytes from a given size.

mkrotate [Pdftransform]

Make a rotation matrix to rotate by a number of radians around a point.

mkscale [Pdftransform]

Make a transformation matrix from an x and y scale and a point to scale about.

mkshearx [Pdftransform]

Matrix to shear in x by a given factor about a point.

mksheary [Pdftransform]

Matrix to shear in y by a given factor about a point.

mktranslate [Pdftransform]

Make a transformation matrix from x and y translation.

mkunit [Pdfutil]

mkunit f x gives fun () -> f x

mkunitvector [Pdfutil]

Make a unit vector in the direction from one point to a second.

mkvector [Pdfutil]

mkvector (a, b) (c, d) makes a vector from point (a, b) to point (c, d).

name_of_colourspace [Pdfspace]

Read the name of a colour, if it has one.

name_to_dingbats [Pdfglyphlist]

Convert a glyph name to a Dingbats encoding number

name_to_macexpert [Pdfglyphlist]

Convert a glyph name to a MacExpert encoding number

name_to_macroman [Pdfglyphlist]

Convert a glyph name to a MacRoman encoding number

name_to_pdf [Pdfglyphlist]

Convert a glyph name to a PDF encoding number

name_to_pdf_hashes [Pdfglyphlist]

Convert a glyph name to a PDF encoding number, hash table version

name_to_standard [Pdfglyphlist]

Convert a glyph name to a Standard encoding number

name_to_symbol [Pdfglyphlist]

Convert a glyph name to a Symbol encoding number

name_to_win [Pdfglyphlist]

Convert a glyph name to a Windows encoding number

nametree_lookup [Pdf]

Calling nametree_lookup pdf k dict looks up the name in the document's name tree

neq [Pdfutil]


never [Pdfutil]

The always-false predicate.

no_more [Pdfio]

A distinguished byte value indicating "no more input"

none [Pdfutil]

Predicates on the someness or noneness of an 'a option.

notnull [Pdfutil]

Predicates on the nullness of a list.

notpred [Pdfutil]

Invert a predicate.

nudge [Pdfio]

Move forward one byte

null_hash [Pdfutil]

The empty zero-sized hash table.

objcard [Pdf]

Return the size of the object map.

objects_of_list [Pdf]

Make a objects entry from a parser and a list of (number, object) pairs.

objects_referenced [Pdf]

Calling objects_referenced no_follow_entries no_follow_contains pdf pdfobject find the objects reachable from the given object.

objiter [Pdf]

Iterate over the objects in a document.

objiter_gen [Pdf]

Iterate over the objects in a document.

objiter_inorder [Pdf]

The same, but in object number order.

objnumbers [Pdf]

List the object numbers in a PDF.

objselfmap [Pdf]

Map over all pdf objects in a document.

odd [Pdfutil]

Even and odd predicates on integers.

offset_point [Pdfutil]

Offset a point by a vector.

option_map [Pdfutil]

Map with a function returning an option, dropping all None results and extracting all Some ones.

option_map2 [Pdfutil]

Like option_map but with a two-argument function and two (equal-length) input lists.

output_of_channel [Pdfio]

Make an output from an OCaml channel

page_object_number [Pdfpage]

Find a page indirect from the page tree of a document, given a page number.

page_reference_numbers [Pdf]

List, in order, the page reference numbers of a PDF's page tree.

pagelabel_of_pagenumber [Pdfpagelabels]

Single label representing a given page.

pagelabeltext_of_pagenumber [Pdfpagelabels]

Return the text for a page label.

pagenumber_of_target [Pdfpage]

Return a page number given a destination.

pages_of_pagetree [Pdfpage]

Extract the page tree from a PDF document and parse it to a list of page objects.

pair [Pdfutil]

A similar function to couple, but the coupling is non-overlapping.

pair_ext [Pdfutil]

A version of pair which adds a unary function for the singleton, much like couple_ext.

pair_reduce [Pdfutil]

As couple_reduce is to couple, so pair_reduce is to pair.

pairs [Pdfutil]

Produce a list of overlapping pairs of elements in a list in order, producing the empty list if on singleton input.

pairs_of_list [Pdfutil]

Make consecutive elements of an even-length list into a list of pairs.

parse [Pdfread]

Parse a PDF object.

parse_function [Pdffun]

Parse a function given a document and function object.

parse_matrix [Pdf]

Calling parse_matrix pdf name dict parses a PDF matrix found under key name in dictionary dict into a Transform.transform_matrix.

parse_operators [Pdfops]

Given a pdf document, resource dictionary and list of streams representing the graphics content (PDF allows a single page's graphics content to be split over several streams), return a list of operators.

parse_rectangle [Pdf]

Parse a PDF rectangle structure into min x, min y, max x, max y.

parse_single_object [Pdfread]

Parse a single object.

parse_single_stream [Pdfops]

Parse a single byte streams to an operator list given a document and resource dictionary.

parse_stream [Pdfops]

Parse a list of byte streams to an operator list given a document and resource dictionary.

pdf_of_channel [Pdfread]

Same as pdf_of_input, but from an OCaml channel.

pdf_of_channel_lazy [Pdfread]

As pdf_of_channel, but delay loading of streams and parsing of objects like pdf_of_input_lazy.

pdf_of_file [Pdfread]

Read a PDF from the given filename with optional user and owner passwords.

pdf_of_input [Pdfread]

Read a PDF from a Pdfio.input, with an optional user password which, if absent, is assumed to be the empty string, and optional owner password.

pdf_of_input_lazy [Pdfread]

Same as pdf_of_input, but delay loading of streams and parsing of objects (they will be loaded and parsed when needed).

pdf_of_pages [Pdfpage]

Return a pdf with a subset of pages, but nothing else changed - exactly the same page object numbers, so bookmarks etc still work.

pdf_to_channel [Pdfwrite]

As pdf_to_output but to an OCaml channel.

pdf_to_file [Pdfwrite]

Simple write to given file name.

pdf_to_file_options [Pdfwrite]

As pdf_to_channel but to a named file.

pdf_to_output [Pdfwrite]

Write a PDF document to an Pdfio.output, optionally encrypting.

pdfdocstring_of_codepoints [Pdftext]

Build a pdf string in pdfdocencoding (if no unicode-only characters are used) or UTF16BE (if they are)

pdfdocstring_of_utf8 [Pdftext]

Take a UTF8 string and convert to pdfdocencoding (if no unicode-only characters are used) or UTF16BE (if they are))

pdfobject_of_destination [Pdfdest]

Write a destination to a Pdf.pdfobject.

pdfobject_of_function [Pdffun]

Flatten a function to its PDF representation

pdfobjmap_empty [Pdf]

Make an empty object map

pdfobjmap_find [Pdf]

Find an object in the object map

peek_byte [Pdfio]

Look at the next byte without advancing the pointer.

peek_char [Pdfio]

Look at the next character without advancing the pointer.

permissions [Pdfread]

Return list of permissions

perpendicular [Pdfutil]

Find the vector pi / 2 anticlockwise from the given one.

pi [Pdfutil]


points [Pdfunits]

Convert a measurement to points

position [Pdfutil]

Position of an element in a list, or None if not found

position_1 [Pdfutil]

Position (1-based) in a list, or None if not found

postpend_operators [Pdfpage]

Add operators to the end of a page.

pow [Pdfutil]

pow x y is y to the power x

pow2gt [Pdfutil]

Largest power of two greater or equal to an integer.

pow2lt [Pdfutil]

Largest power of two smaller or equal to an integer.

prepend_operators [Pdfpage]

Add operators to the beginning of a page.

print_bytes [Pdfio]

Print bytes to standard output.

print_document_ocg [Pdfocg]

Print information about the document's Optional Content Groups to Standard Output.

print_floats [Pdfutil]

Print a list of floating point numbers separated by spaces.

print_function [Pdffun]

Print a function to Standard Output.

print_int32s [Pdfutil]

Print a list of int32s separated by spaces

print_ints [Pdfutil]

Print a list of integers separated by spaces

print_lexeme [Pdfread]

Print a lexeme to Standard Output with a space after it, for debug.

protect [Pdfpage]

Calling protect pdf add stack operators to a pre-ISO content stream to ensure it is composeable.

putbit [Pdfio]

Put a single bit, 0 or 1.

putval [Pdfio]

Put a multi-bit value (given as an int32) containing the given number of useful bits into a bitstream

rad_of_deg [Pdfutil]
read [Pdfafm]

Return the header lines (header item, contents), character metrics (character, width) and kerning pairs (char1, char2, kerm), and (charname, width) pairs from an AFM file.

read [Pdfpagelabels]

Read the page labels from a document

read_bookmarks [Pdfmarks]

Read the bookmarks from a document.

read_char_back [Pdfio]

Read the previous character (if there is one), moving the pointer back one.

read_colourspace [Pdfspace]

Read a colourspace from a PDF given a document, page resources dictionary and the colourspace object

read_debug [Pdfread]

If set, some debug output is produced.

read_destination [Pdfdest]

Read a destination given a PDF and destionation object.

read_font [Pdftext]

Read a font from a given document and object

read_header [Pdfread]

Read a PDF header

read_line [Pdfio]

Read a line from an input in the manner of Stdlib.read_line.

read_lines [Pdfio]

Read all the lines in an input, in the manner of Stdlib.read_line.

read_ocg [Pdfocg]

Read optional content data.

really_drop_evens [Pdfutil]

Same as drop_evens, but don't save the last element.

recompose [Pdftransform]

Recompose from the above information.

recrypt_pdf [Pdfcrypt]

recrypt_pdf decrypted_and_modified re-encrypts a PDF document which was decrypted using the user password and owner password from the original encrypted file and the same permissions and encryption parameters.

rectangle_of_paper [Pdfpage]

Make a PDF rectangle from a Paper.papersize.

recurse_array [Pdf]

Similarly for an Array.

recurse_dict [Pdf]

Use the given function on each element of a PDF dictionary.

remove [Pdfpagelabels]

Remove all page labels.

remove [Pdfutil]

Remove something from a list, if it's there.

remove_bookmarks [Pdfmarks]

Remove the bookmarks from a document.

remove_dict_entry [Pdf]

Remove a dictionary entry, if it exists.

remove_duplicate_fonts [Pdfmerge]

Remove duplicate fonts from a PDF.

remove_unreferenced [Pdf]

Garbage-collect a pdf document.

removeobj [Pdf]

Remove the given object

renumber [Pdf]

Perform the given renumberings on a PDF.

renumber_object_parsed [Pdf]

Renumber an object given a change table.

renumber_pages [Pdfpage]

Rename the resources within a number of page resource dictionaries and contents, so as to allow them to be merged without name clashes.

renumber_pdfs [Pdf]

Make a number of PDF documents contain no mutual object numbers.

replace [Pdfutil]

replace k v l replaces the existing binding of k in l with one with binds k to v.

replace_dict_entry [Pdf]

replace_dict_entry dict key value replaces a dictionary entry, raising Not_found if it's not there.

replace_number [Pdfutil]

replace n x xs replaces the nth element of the list xs with x (the first is element 1)

replaceinlist [Pdfutil]

replaceinlist f x l replaces any element of l for which f l is true with x.

rev [Pdfutil]
rev_compare [Pdfutil]

Like, but the other way around.

rev_map [Pdfutil]
rev_map3 [Pdfutil]

Similar to rev_map, but 3 arguments.

rev_map4 [Pdfutil]

Similar to rev_map, but 4 arguments.

rev_map5 [Pdfutil]

Similar to rev_map, but 5 arguments.

rev_map6 [Pdfutil]

Similar to rev_map, but 6 arguments.

reverse_glyph_hashes [Pdfglyphlist]

The reverse of glyph_hashes.

reverse_name_to_pdf_hashes [Pdfglyphlist]

Convert a PDF encoding number to glyph name, hash table version.

reverse_table_of_encoding [Pdftext]

Reverse table of all the entries in an encoding.

revisions [Pdfread]

Read the number of revisions of the document, by performing a dummy read.

rewind [Pdfio]

Move backward one byte

roman_lower [Pdfutil]

Lowercase roman representation of a number

roman_upper [Pdfutil]

Uppercase roman representation of a number

root2 [Pdfutil]

Square root of two.

rotation_of_int [Pdfpage]

The reverse.

round [Pdfutil]

Round a real.

safe_float [Pdfutil]

Make sure a floating point number is no degenarate, by making it zero if it is.

scalevectolength [Pdfutil]

Scale a vector to a given length.

select [Pdfutil]

Select the nth element in a list (first is element 1).

set [Pdfutil]

Set a boolean reference to true

set_array [Pdfutil]

Set all the values of an array.

setify [Pdfutil]

Remove duplicates from a list.

setify_preserving_order [Pdfutil]

Same as setify, but preserve order.

setinit [Pdfio]

setinit i s o l sets s o...o + l - 1 from the input

setinit_string [Pdfio]

setinit_string i s o l sets s o...o + l - 1 from the input

setminus [Pdfutil]

The set setminus a b contains all those elements which are in a but are do not appear in b.

setminus_preserving_order [Pdfutil]

The same, but preserving order

sha256 [Pdfcryptprimitives]

SHA256 digest

sha384 [Pdfcryptprimitives]

SHA344 digest

sha512 [Pdfcryptprimitives]

SHA512 digest

shortest_unused_prefix [Pdfpage]

Find the shortest lower-case alphabetic string which is not a prefix of any name in /Resources.

sign_extend [Pdfutil]

The call sign_extend l n extends n of length l bits to fit a native integer

simplify_utf16be [Pdftext]

Remake a UTF16BE string into a PDFDocEncoding string if all characters are in PDFDocEncoding

some [Pdfutil]
sort [Pdfutil]

Tail-recursive versions of list functions (and some simple variations).

split [Pdfutil]
split3 [Pdfutil]
split5 [Pdfutil]
split6 [Pdfutil]
split8 [Pdfutil]
split_around [Pdfutil]

Split a list into a list of lists at every point where a predicate is true

splitat [Pdfutil]

Split a list at the given positions.

splitinto [Pdfutil]

Split a list into some lists of length n (and possibly a final one of length < n), preserving order.

splitinto_small [Pdfutil]

Non-tail recursive version of splitinto, for use only when n is small and fixed.

sqr [Pdfutil]

Square a number

sr32 [Pdfutil]
sr64 [Pdfutil]
standard_font_of_name [Pdftext]

Parses a string such as "/Times-Bold" or "/TimesNewRoman,Bold" to Pdftext.TimesRomanBold etc.

starts_with [Pdfutil]

The standard OCaml starts_with function, for versions of OCaml too old to have it.

stemv_of_standard_font [Pdfstandard14]

Return a suitable StemV value for a standard font

stream_of_ops [Pdfops]

Flatten a list of operators to an uncompressed PDF stream.

string_of_bookmark [Pdfmarks]

Debug string from a bookmark.

string_of_bytes [Pdfio]

Make a string from a bytes.

string_of_char [Pdfutil]

Make a string from a character.

string_of_colourspace [Pdfspace]

Produce a debug string

string_of_date [Pdfdate]

Build a string from a date.

string_of_font [Pdftext]

A debug string for the whole font datatype.

string_of_input [Pdfio]

string_of_input i gives a string with the contents of i

string_of_int_array [Pdfio]

A string from a single int array

string_of_int_arrays [Pdfio]

A string from a list of integer arrays

string_of_lexeme [Pdfread]

String representation of a lexeme

string_of_matrix [Pdftransform]

String of a transformation matrix.

string_of_op [Pdfops]

Make a string of a single operator (for debug purposes).

string_of_ops [Pdfops]

Same as string_of_op, but of several operators (for debug purposes).

string_of_pagelabel [Pdfpagelabels]

Debug string of page label

string_of_pdf [Pdfwrite]

Calculate a string of a pdf object.

string_of_pdf_including_data [Pdfwrite]

Calculate a string of a pdf object, but include binary data too.

string_of_standard_font [Pdftext]

Returns a string such as "Times-Bold" for Pdftext.TimesBold etc.

string_of_token [Pdfgenlex]

For debug only.

string_of_tokens [Pdfgenlex]

For debug only.

string_of_transform [Pdftransform]

Make a string of a transform for debug purposes.

string_replace_all [Pdfutil]

Calling string_replace_all x x' s replaces all instances of x with x' in s, returning a new string.

string_replace_all_lazy [Pdfutil]

The same, but provide a function for the replacement string

sum [Pdfutil]

Sum of a list of integers.

swap [Pdfutil]

Swaps the data at the given indexes in an array.

symbol_afm [Pdfafmdata]
table_of_encoding [Pdftext]

Table of all the entries in an encoding.

tail_no_fail [Pdfutil]

Like but [] yields [].

tails [Pdfutil]

Ditto, tails.

take [Pdfutil]

take l n takes n elements from the list raising Invalid_argument if there are not enough elements to take or if n < 0.

take' [Pdfutil]

The same as take, but with the arguments reversed.

takewhile [Pdfutil]

Take elements from a list while a given predicate is true, returning them in order.

takewhile_reverse [Pdfutil]

The same as takewhile, but the list is returned in reverse order.

target_of_pagenumber [Pdfpage]

Build a basic Fit destintation from a page number of a PDF.

text_extractor_of_font [Pdftext]

Build a text extractor from a document and font object

text_extractor_of_font_real [Pdftext]

Build a text extractor from a document and a font

textwidth [Pdfstandard14]

Calculate the width, in millipoints, of a string in the given font, taking into account kerning if the first argument is true.

times_bold_afm [Pdfafmdata]
times_bold_italic_afm [Pdfafmdata]
times_italic_afm [Pdfafmdata]
times_roman_afm [Pdfafmdata]
tl [Pdfutil]
toint [Pdfutil]

Same as Stdlib.int_of_float

transform [Pdftransform]

Transform a coordinate by a given transform.

transform_annotations [Pdfannot]
transform_bookmark [Pdfmarks]

Transform a bookmark's destination

transform_destination [Pdfdest]

Transform a destination by a matrix

transform_matrix [Pdftransform]

Transform a coordinate by a given transformation matrix.

tryfind [Pdfutil]

Option lookup on hashtables

tuple [Pdfutil]

Make a tuple.

uncompress [Pdfflate]

Uncompress data.

unique_key [Pdf]

Given a dictionary and a prefix (e.g gs), return a name, starting with the prefix, which is not already in the dictionary (e.g /gs0).

unit [Pdfpaper]

Project the unit from a paper size

unopt [Pdfutil]

Strip the Some from an option.

uslegal [Pdfpaper]

United States paper sizes.

usletter [Pdfpaper]
utf16be_of_codepoints [Pdftext]

A UTF16BE string for a list of unicode codepoints (with BOM)

utf8_of_codepoints [Pdftext]

A UTF8 string for a list of unicode codepoints

utf8_of_pdfdocstring [Pdftext]

Take a pdf string (which will be either pdfdocencoding or UTF16BE) and return a string representing the same unicode codepoints in UTF8

veclength [Pdfutil]

The length of a vector.

what_encryption [Pdfread]

Return encryption method in use

width [Pdfpaper]

Project the width from a paper size.

write [Pdfpagelabels]

Write page labels to a document, replacing any there.

write_bitstream_append_aligned [Pdfio]

Append two write bitstreams, aligning at boundary

write_colourspace [Pdfspace]

Write a colourspace to a PDF, returning it.

write_debug [Pdfwrite]

When set to true, various pieces of information are printed to standard output when a PDF is written.

write_font [Pdftext]

Write a font to a given document, returning the object number for the main font dictionary

write_ocg [Pdfocg]

Write optional content data.

zapf_dingbats_afm [Pdfafmdata]

We pass unit because the AFM files are parsed upon demand and then memoised.

zipn [Pdfutil]

Take a list of lists of equal length, and turn into a list of lists, the first containing all the first elements of the original lists, the second the second, and so on.