File: cpdfposition.mli

package info (click to toggle)
cpdf 2.8.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,828 kB
  • sloc: ml: 34,724; makefile: 65; sh: 45
file content (31 lines) | stat: -rw-r--r-- 937 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
(** Positions *)

(** Possible positions for adding text and other uses. See cpdfmanual.pdf *)
type position =
    PosCentre of float * float
  | PosLeft of float * float
  | PosRight of float * float
  | Top of float
  | TopLeft of float * float
  | TopRight of float * float
  | Left of float
  | BottomLeft of float * float
  | Bottom of float
  | BottomRight of float * float
  | Right of float
  | Diagonal
  | ReverseDiagonal
  | Centre

(** Produce a debug string of a [position] *)
val string_of_position : position -> string

(** [calculate_position ignore_d w (xmin, ymin, xmax, ymax) orientation pos] calculates
the absolute position of text given its width, bounding box, orientation and
position. If [ignore_d] is true, the distance from the position (e.g 10 in
TopLeft 10) is ignored (considered zero). *)
val calculate_position :
  bool ->
  float ->
  float * float * float * float ->
  position -> float * float * float