pub struct BoundingBox {
pub x: f64,
pub y: f64,
pub width: f64,
pub height: f64,
}Expand description
Bounding box for text positioning in PDF coordinate space
PDF coordinates start at bottom-left (0,0) with Y increasing upward. This structure represents a rectangular region where extracted text was found.
§Coordinate System
(0, height) (width, height)
┌─────────────────────┐
│ │
│ Text content │
│ │
└─────────────────────┘
(0, 0) (width, 0)§Examples
use oxidize_pdf::text::invoice::BoundingBox;
let bbox = BoundingBox::new(50.0, 100.0, 200.0, 20.0);
assert!(bbox.contains(150.0, 110.0)); // Point inside
assert!(!bbox.contains(300.0, 110.0)); // Point outside
assert_eq!(bbox.area(), 4000.0);Fields§
§x: f64X coordinate of left edge (in PDF points from page origin)
y: f64Y coordinate of bottom edge (in PDF points from page origin)
width: f64Width of the box (in PDF points)
height: f64Height of the box (in PDF points)
Implementations§
Trait Implementations§
Source§impl Clone for BoundingBox
impl Clone for BoundingBox
Source§fn clone(&self) -> BoundingBox
fn clone(&self) -> BoundingBox
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for BoundingBox
Source§impl Debug for BoundingBox
impl Debug for BoundingBox
Source§impl PartialEq for BoundingBox
impl PartialEq for BoundingBox
impl StructuralPartialEq for BoundingBox
Auto Trait Implementations§
impl Freeze for BoundingBox
impl RefUnwindSafe for BoundingBox
impl Send for BoundingBox
impl Sync for BoundingBox
impl Unpin for BoundingBox
impl UnsafeUnpin for BoundingBox
impl UnwindSafe for BoundingBox
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more