Liking cljdoc? Tell your friends :D

pdfplumber.geometry

Bounding-box math and coordinate conversion.

The public coordinate system has a top-left origin (matching Python pdfplumber): a bounding box is [x0 top x1 bottom] in PDF user-space points with x0 <= x1 and top <= bottom. PDFBox works in a bottom-left origin, so conversion happens here and nowhere else. All extraction code must use these helpers rather than open-coding the arithmetic.

Bounding-box math and coordinate conversion.

The public coordinate system has a top-left origin (matching Python
`pdfplumber`): a bounding box is `[x0 top x1 bottom]` in PDF user-space points
with `x0 <= x1` and `top <= bottom`. PDFBox works in a bottom-left origin, so
conversion happens here and nowhere else. All extraction code must use these
helpers rather than open-coding the arithmetic.
raw docstring

bbox-heightclj

(bbox-height [_ top _ bottom])
source

bbox-widthclj

(bbox-width [x0 _ x1 _])
source

centerclj

(center [x0 top x1 bottom])

Midpoint [x y] of a bbox.

Midpoint `[x y]` of a bbox.
sourceraw docstring

contains?clj

(contains? [ox0 otop ox1 obot] [ix0 itop ix1 ibot])

True when inner lies entirely within outer (boundaries inclusive).

True when `inner` lies entirely within `outer` (boundaries inclusive).
sourceraw docstring

flip-yclj

(flip-y page-height y)

Convert a single y between bottom-origin and top-origin about page-height. Self-inverse: (flip-y h (flip-y h y)) == y.

Convert a single y between bottom-origin and top-origin about `page-height`.
Self-inverse: `(flip-y h (flip-y h y)) == y`.
sourceraw docstring

intersectionclj

(intersection [ax0 atop ax1 abot] [bx0 btop bx1 bbot])

Overlap bbox of a and b, or nil when they do not overlap with positive area.

Overlap bbox of `a` and `b`, or nil when they do not overlap with positive area.
sourceraw docstring

intersects?clj

(intersects? [ax0 atop ax1 abot] [bx0 btop bx1 bbot])

True when a and b overlap with positive area. Edge-touching boxes (zero overlap area) are not considered intersecting.

True when `a` and `b` overlap with positive area. Edge-touching boxes (zero
overlap area) are not considered intersecting.
sourceraw docstring

pdfbox-rect->bboxclj

(pdfbox-rect->bbox page-height x y w h)

Convert a PDFBox lower-left rectangle (x y w h) on a page of page-height into a public top-left bbox [x0 top x1 bottom].

Convert a PDFBox lower-left rectangle `(x y w h)` on a page of `page-height`
into a public top-left bbox `[x0 top x1 bottom]`.
sourceraw docstring

within?clj

(within? [x0 top x1 bottom] [x y])

True when point [x y] falls inside bbox (boundaries inclusive).

True when point `[x y]` falls inside `bbox` (boundaries inclusive).
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close