Comment puis-je définir le texte en haut (il y a une première ligne dans la mise en forme standard du corps avant) et il n'est pas réglé sur l'alignement TOP?Python pptx - Comment paramétrer les puces et l'alignement supérieur
La fonction Add_paragraph n'a pas activé le niveau des points de balle (niveau = 0)?
Quelqu'un a eu une idée sur la façon de résoudre ce problème? (Voir image pour comprendre la question sur la gauche et le but sur le côté droit)
# Shape position
left = Inches(0.4)
top = Inches(1.5)
width = Inches(4.5)
height = Inches(1.6)
box = shape.add_shape(MSO_SHAPE.RECTANGLE, left, top, width, height)
text_frame = box.text_frame
text_frame.clear() # not necessary for newly-created shape
#Fill
fill = box.fill
line = box.line
fill.solid()
fill.fore_color.theme_color = MSO_THEME_COLOR.ACCENT_6
line.color.theme_color = MSO_THEME_COLOR.ACCENT_6
p = text_frame.add_paragraph()
run = p.add_run()
# bullet ?
#p.level = 0
# Top position?
p.vertical_anchor = MSO_ANCHOR.TOP
p.alignment = PP_ALIGN.LEFT
p.margin_left = Inches(0.02)
p.margin_top = Inches(0.00)
#p.margin_bottom = Inches(0.08)
run.text = "..."
# Fonts
font = run.font
font.name = 'Arial (Body)'
font.size = Pt(8)
font.bold = False
font.italic = None # cause value to be inherited from theme
font.color.theme_color = MSO_THEME_COLOR.ACCENT_1
https://python-pptx.readthedocs.io/en/latest/user/quickstart.html#add-textbox-example – Joe
[This] (https://github.com/scanny/python-pptx/issues/100) de 2014 semble indiquer qu'il n'y a pas encore d'option pour ajouter des puces. – ikkuh