Skip to content

Allow reading orders dectors to support any class that has a bounding box/PdfRectangle #855

@davebrokit

Description

@davebrokit

Currently the interface IReadingOrderDetector relies on TextBlock as a parameter. This limits it's use to the TextBlock class.

I propose adding an IBoundingBox interface

public interface IBoundingBox
{
    PdfRectangle BoundingBox { get; }
}

Then changing IReadingOrderDector interface and implementing classes to use IBoundingBox as it's parameter

Adding an overload that takes a Func<T, PdfRectangle> would allow the caller to specify any bounding box making the interface more useful.

Breaking changes: The IReadingOrderDector will instead return an IReadOnlyList<T> which will be the ordered results. This would mean TextBlock.ReadingOrder is not set which is a breaking change. But some code can be added that if type T is TextBlock then ReadingOrder is set

Happy to make the changes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions