Skip to content

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

Closed
davebrokit wants to merge 1 commit intoUglyToad:masterfrom
davebrokit:master
Closed

Allow reading orders dectors to support any class that has a bounding box/PdfRectangle#859
davebrokit wants to merge 1 commit intoUglyToad:masterfrom
davebrokit:master

Conversation

@davebrokit
Copy link
Contributor

  • Introduce IBoundingBox interface

#855

… box/PdfRectangle

- Introduce IBoundingBox interface
{
using Core;
using Graphics.Colors;
namespace UglyToad.PdfPig.Content
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what happened here (Formating tabs/whitespace?). Only added interface and

        /// <summary>
        /// Gets the Bounding Box: The rectangle completely containing this object
        /// </summary>
        public PdfRectangle BoundingBox => GlyphRectangle;

public IEnumerable<TBlock> Get<TBlock>(IEnumerable<TBlock> blocks)
where TBlock : IBoundingBox
{
if (typeof(TBlock) != typeof(TextBlock))
Copy link
Contributor Author

@davebrokit davebrokit Jun 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we throw here instead?

This reading order detector would only work with type TextBlock. Should we throw when the type is not that? Right now just return the enumerable as is

@davebrokit davebrokit closed this Jun 28, 2024
@davebrokit
Copy link
Contributor Author

Need to do some refactoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant