title: docx-python word doc page break
body: <p>I am trying to add a page break to the middle of a document using the docx-python library.</p>
  
  <p>It would appear that when adding a pagebreak, the page break is added to the end of the document. Is there a method to add a page break to a specific location?</p>
  
  <p>This is my current code.</p>
  
  <pre><code>from docx import Document
  from docx.shared import Inches
  
  demo='gm.docx'
  document = Document(docx=demo)
  
  for paragraph in document.paragraphs:
      if 'PUB' in paragraph.text:
          document.add_page_break()
  
  document.save('gm.docx')
  </code></pre>