Table of Contents

Class RegionSearchOptions

Namespace
LMKit.Document.Search
Assembly
LM-Kit.NET.dll

Options for region-based search.

public sealed class RegionSearchOptions
Inheritance
RegionSearchOptions
Inherited Members

Examples

Example: Extract text from the top-left quadrant of a page.

using LMKit.Document.Search;
using LMKit.Graphics.Geometry;

var regionOptions = new RegionSearchOptions { IncludePartial = true, // Include elements that partially overlap the region MergeTouching = true // Merge adjacent text elements into larger spans };

var region = new Rectangle(0, 0, 0.5, 0.5); // Top-left quarter (normalized coordinates)

var engine = new LayoutSearchEngine(); IReadOnlyList<TextRegion> elements = engine.FindInRegion(page, region, regionOptions);

foreach (TextRegion element in elements) { Console.WriteLine(element.Snippet); }

Properties

IncludePartial

If true, any intersection with the region qualifies; otherwise, the element must be fully contained within the region.

MergeTouching

If true, adjacent text elements inside the region will be merged into larger spans.

Share