Open qihangsheji opened 9 months ago
Most of the time, it's not available. font.color.type is None , But in fact there are colors ` for paragraph in shape.text_frame.paragraphs: print("paragraph") print(paragraph.font.color.type) for run in paragraph.runs:
print("run") print(run.font.color.type) font_name = run.font.name #font_size = run.font.size.pt # 字体大小(以磅为单位) font_color = run.font.color`
have you tried reading the rgb value from run.font.color.rgb?
there has an error. AttributeError: no .rgb property on color type '_NoneColor'
Most of the time, it's not available. font.color.type is None , But in fact there are colors ` for paragraph in shape.text_frame.paragraphs: print("paragraph") print(paragraph.font.color.type) for run in paragraph.runs:
提取文本内容、字体、大小和颜色