PdfElixide.Document.Span (pdf_elixide v0.23.0)

Copy Markdown View Source

A run of text sharing one text state — the same font, size, color, and text-state parameters — extracted from a PDF page, with its zero-based page index and bounding box.

Float fields follow the "Unbounded values" rule in PdfElixide.Geometry.Rect.

:bbox and :page_bbox

In raw user space, :bbox measures the run along its writing axis: width is its advance and height its font size. A displayed frame may transpose those dimensions; see Rotated pages and extracted geometry.

:page_bbox is the smallest axis-aligned rectangle covering the run, in the same frame as :bbox. It equals :bbox when :rotation is 0.0. Use it for layout or hit-testing, and use :bbox to measure the text along its writing axis.

Summary

Types

t()

@type t() :: %PdfElixide.Document.Span{
  bbox: PdfElixide.Geometry.Rect.t(),
  bold?: boolean(),
  char_spacing: float(),
  color: PdfElixide.Color.RGB.t(),
  font: String.t(),
  font_size: float(),
  font_weight: non_neg_integer(),
  heading_level: pos_integer() | nil,
  horizontal_scaling: float(),
  italic?: boolean(),
  mcid: non_neg_integer() | nil,
  monospace?: boolean(),
  page: non_neg_integer(),
  page_bbox: PdfElixide.Geometry.Rect.t(),
  rotation: float(),
  text: String.t(),
  text_rise: float(),
  word_spacing: float()
}