-
Notifications
You must be signed in to change notification settings - Fork 1.1k
How to get the color of a character? #220
Comments
If we look at the implementation of LTChar Line 224 in 8150458
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. |
I have same problem now. |
Is this Pull Request about this problem? #197 |
Is there a fix to this ? I've all others info in the LTChar (bold, italic, font, size) but still not finding color information. |
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? |
@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? |
Could you share your code, how to get the bold, italic of the font? Thank you! |
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'
The text was updated successfully, but these errors were encountered: