pub struct Placement {
pub page_number: u32,
pub bounding_box: BoundingBox,
pub line_number: u32,
pub segment_number: u32,
pub rotation: i32,
pub paragraph_number: u32,
pub region_label: Option<String>,
pub page_width: f32,
pub page_height: f32,
}Expand description
Spatial and structural metadata about where a text element lives in its source.
Populated for PDF-sourced elements. Future HTML/Markdown preprocessors may produce
elements with placement: None.
Fields§
§page_number: u321-indexed page number on the source PDF.
bounding_box: BoundingBoxBounding box on the PDF page.
line_number: u320-indexed line number within the paragraph. From data-line on span.
segment_number: u320-indexed segment number within the line. From data-segment on span.
rotation: i32Text rotation in degrees: 0, 90, 180, 270. Non-zero when inside <aside data-rotation="N"> (CR-10).
paragraph_number: u32Tika’s paragraph number within the page (per-page counter, reset each page). This is a Y-gap heuristic — reliable for clean prose, less so for math/list content.
region_label: Option<String>Region tree leaf label this element belongs to. Set by Block 06b
(analytics::reading_order::tag_and_resort) when the analytics
pre-pass runs. Values:
Some("1"),Some("2-1"), etc. — body element in the named Region tree leaf (depth-first reading-order path fromRegionStats.per_page[…].root).Some("H-1"),Some("H-2"), … — header element (y-asc within the page’s headers abovegeometry.header_y).Some("F-1"),Some("F-2"), … — footer element (y-asc within the page’s footers belowgeometry.doc_footer_y).None— orphan element (within body Y range but outside the body X range — marginalia, sidebar). Placed at the end of the page’s reading order in original Tika sequence.
Internal pipeline state — not a public schema field. Optional via
#[serde(default)] so caches that predate this field deserialize
cleanly with region_label = None.
page_width: f32Width of the source PDF page in points. Sourced from Tika’s
<div class="page-meta" data-width=…> (added by Tika as part of
the layout-reasoning consolidation flow). Carried on every
element so analytics can size per-page heatmaps without a
per-page side-channel.
#[serde(default)] keeps c2-preprocessor caches written before
this field existed deserializable; the value is 0.0 in that case
and consumers should treat 0.0 as “unknown”.
page_height: f32Height of the source PDF page in points. See page_width.