cpdf-source/cpdfposition.mli

32 lines
937 B
OCaml
Raw Normal View History

2022-01-13 16:18:21 +01:00
(** Positions *)
2021-08-12 21:38:55 +02:00
(** 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
2023-04-07 16:31:21 +02:00
| TopLeft of float * float
| TopRight of float * float
2021-08-12 21:38:55 +02:00
| Left of float
2023-04-07 16:31:21 +02:00
| BottomLeft of float * float
2021-08-12 21:38:55 +02:00
| Bottom of float
2023-04-07 16:31:21 +02:00
| BottomRight of float * float
2021-08-12 21:38:55 +02:00
| 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 ->
2022-09-21 18:40:28 +02:00
position -> float * float * float