Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

How to get the color of a character? #220

Open
NehaPandey58 opened this issue May 30, 2018 · 7 comments
Open

How to get the color of a character? #220

NehaPandey58 opened this issue May 30, 2018 · 7 comments

Comments

@NehaPandey58
Copy link

How to get the color of a character?

I am trying to run the following code:
if isinstance(c, LTChar):
print( c.ncs.name, c.nc)

Output:
AttributeError: 'LTChar' object has no attribute 'ncs'

@NehaPandey58 NehaPandey58 changed the title How to How to get the color of a character? May 30, 2018
@RolandColored
Copy link

If we look at the implementation of LTChar

def __init__(self, matrix, font, fontsize, scaling, rise,

there don't seem to be anything which stores the color. Maybe it's somewhere in the font variable, but it's not stored at this place.

@ghost
Copy link

ghost commented Jul 2, 2018

I have same problem now.
Could anyone teach me?

@ghost
Copy link

ghost commented Jul 2, 2018

Is this Pull Request about this problem? #197

@CartierPierre
Copy link

CartierPierre commented Sep 23, 2019

Is there a fix to this ? I've all others info in the LTChar (bold, italic, font, size) but still not finding color information.
Edit : I also not found underlined information

@Ramlinbird
Copy link

Same question, is there a fix to this? I generate standard pdf from latex and still can't get the correct color. Some pdfs are OK. (By the way, I used pdfminer.six, because pdfminer seems not have this attribute). I checked it, and found that in initialization stage, the pdfminer seems to be failed at reading colorspace infos, but I open the pdf in vim, and the colorspace is visible. Anyone has good solution at reading text's color?

@EricAndrechek
Copy link

@CartierPierre How did you manage to find italic and bold? I am currently just searching to see if the font name includes "bold", but did you find a better way?

@wayi93
Copy link

wayi93 commented May 18, 2020

Is there a fix to this ? I've all others info in the LTChar (bold, italic, font, size) but still not finding color information.
Edit : I also not found underlined information

Could you share your code, how to get the bold, italic of the font? Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants