title: python-docx get words position and attributes
body: <p>I'm looking for a means to extract the position (x, y) and attributes (font / size) of every word in a document.</p>
  
  <p>From the python-docx docs, I know that :</p>
  
  <blockquote>
    <p>Conceptually, Word documents have two layers, a text layer and a
    drawing layer. In the text layer, text objects are flowed from left to
    right and from top to bottom, starting a new page when the prior one
    is filled. In the drawing layer, drawing objects, called shapes, are
    placed at arbitrary positions. These are sometimes referred to as
    floating shapes.</p>
    
    <p>A picture is a shape that can appear in either the text or drawing layer. When it appears in the text layer it is called an inline shape,
    or more specifically, an inline picture.</p>
    
    <p>[...] At the time of writing, python-docx only supports inline pictures.</p>
  </blockquote>
  
  <p>Yet, even if it is not the gist of it, I'm wondering if something similar exists : </p>
  
  <pre><code>from docx import Document
  main_file = Document("/tmp/file.docx")
  for paragraph in main_file.paragraphs:
      for word in paragraph.text:  # &lt;= Non-existing (yet wished) functionnalities, IMHO
          print(word.x, word.y)  # &lt;= Non-existing (yet wished) functionnalities, IMHO
  </code></pre>
  
  <p>Does somebody has an idea ? 
  Best,
  Arthur</p>