Module PDF.R

type t = {
  1. read : bytes -> int -> int -> int;
  2. read_ba : (int -> (char, Stdlib.Bigarray.int8_unsigned_elt, Stdlib.Bigarray.c_layout) Stdlib.Bigarray.Array1.t) option;
  3. custom_parser : (Metadata__.MetadataBase.parser_handler -> unit) option;
  4. seek : int -> unit;
  5. size : unit -> int option;
  6. reset : unit -> unit;
}

A function to read taking the buffer to fill the offset and the length and returning the number of bytes actually read.

val retry : ('a -> int -> int -> int) -> 'b -> int -> int -> int

Make a reading function retry until buffer is filled (or an error occurs).

val read : t -> int -> string
val read_tag : length:int -> label:string -> t -> string option
val drop : t -> int -> unit
val byte : t -> int
val uint8 : t -> int
val int16_be : t -> int
val int16_le : t -> int
val uint16_le : t -> int
val int16 : Metadata__.MetadataBase.endianness -> t -> int
val int24_be : t -> int
val int32_le : t -> int
val uint32_le : t -> int
val int32_be : t -> int
val int64_be : t -> int64
val size : t -> int option
val reset : t -> unit

Reset state like after the file was just opened (position is at the beginning in particular).

val find : t -> string -> bool

Try to find a specific string starting from current position in the file.

val until : t -> string -> string

Return the contents until we reach a specific string (not included).

val with_file : ?custom_parser:(Metadata__.MetadataBase.parser_handler -> unit) -> (t -> 'a) -> string -> 'b
val with_string : ?custom_parser:(Metadata__.MetadataBase.parser_handler -> unit) -> (t -> 'a) -> string -> 'b