Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ragaeeb/kokokor/llms.txt
Use this file to discover all available pages before exploring further.
Overview
PageContext provides essential information about the page geometry and resolution (DPI) needed for accurate text reconstruction. This metadata helps Kokokor normalize measurements, detect layout patterns, and make informed decisions about text structure.Type Definition
Fields
Page width in pixels.This represents the total horizontal dimension of the document image. Used for:
- Centering detection
- Margin calculation
- Layout analysis
Page height in pixels.This represents the total vertical dimension of the document image. Used for:
- Footnote detection
- Overall layout analysis
Horizontal DPI (dots per inch).The horizontal resolution of the document image. Used to:
- Convert pixel measurements to physical units
- Scale tolerance values appropriately
- Normalize measurements across different scan resolutions
Vertical DPI (dots per inch).The vertical resolution of the document image. Used to:
- Convert pixel measurements to physical units
- Scale vertical spacing calculations
- Normalize measurements across different scan resolutions
Usage Example
DPI Importance
The DPI values are critical for accurate text reconstruction:Getting Page Context
Extract page context from various sources:See Also
- reconstructParagraphs - Main function using PageContext
- MapObservationsToTextLinesOptions - Uses DPI for scaling tolerances
- BoundingBox - Position and dimensions in pixels