PdfElixide.Document.SearchMatch (pdf_elixide v0.12.0)

Copy Markdown View Source

One occurrence of a pattern found by PdfElixide.Document.search/2, with its zero-based page index, the matched text, and where it sits on the page.

Both :bbox and every entry of :span_boxes are whole-span boxes rather than the extents of the matched text itself: a match inside a longer run of text reports the box of that whole run. Draw from :span_boxes, which has one entry per run the match touched.

The Search guide has the rest, including how far :bbox over-covers, why a match can cross what looks like a line break, and when the boxes come back empty.

Summary

Types

t()

@type t() :: %PdfElixide.Document.SearchMatch{
  bbox: PdfElixide.Geometry.Rect.t(),
  page: non_neg_integer(),
  span_boxes: [PdfElixide.Geometry.Rect.t()],
  text: String.t()
}