Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 1 commit into from

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