I borrowed this python code here (first answer by enno groper) to automate the extraction of annotations from pdfs.
I want to make some modifications to the code. Trying to fetch the color of annotations with annot_mapping.annot.get_color()
I ran into the first issue. What the command returns is objects like this one <PopplerColor at 0x1a85180>
, rather than rgb values (promised here).
According to poppler docs poppler_annot_get_color()
returns "a new allocated PopplerColor with the color values of poppler_annot , or NULL. It must be freed with g_free() when done".
Is this correct and if yes, how do I achieve this in python?