Skip to content

Font colour is not available via TextElement class or otherwise #54

@NeilTalbott

Description

@NeilTalbott

Is your feature request related to a problem? Please describe.
I have a PDF which uses colours to distinguish certain elements. I can read the text with tabula-sharp but there seems to be no way to discern the font colour for each character. This makes interpreting the text dramatically more difficult, instead of a one-line filter for the coloured text I'm trying to extract.

Describe the solution you'd like
PdfPig exposes the relevant information via the Letter class which has a Color property (and StrokeColor, FillColor). The TextElement has an internal Letter letter field which holds the appropriate Letter object but it is internal and I can't see a way to obtain the relevant colour properties, except by using Reflection.

Describe alternatives you've considered
The only workaround I can see while continuing to use tabula-sharp is to use Reflection to obtain the colour properties of the Letter objects. Although this works, it is slow and also brittle to future updates to tabula-sharp or PdfPig.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions