doc = docx.Document()
paragraph =doc.add_paragraph()
run = paragraph.add_run() run.add_picture('./image/myImage.png')
paragraph.paragraph_format.left_indent = -Inches(1.25)
# Set the top margin of the first paragraph to zero
doc.sections[0].top_margin = docx.shared.Pt(0)
I wanted to add an image, the code indeed added the image to the document, however i wanted the image to appear above text and not behind it. How do we go about it?
New contributor
Brighton Chinhongo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.