title: Using python PyMuPDF (fitz) to iterate through lines and check length of it and add a period if it meets the criteria
body: <p>Trying to iterate through each line of the page from the PyMuPDF library to check the length of the sentence, if it is less than 10 words then I would like to add a full stop.
  Psuedo code would be:</p>
  <pre><code>#loop through the lines of the PDF
  #check number of words in line
  #if line has less than 10 words 
  #add period 
  </code></pre>
  <p>Real code below:</p>
  <pre><code>import fitz
  myfile = &quot;my.pdf&quot;
  doc  =fitz.open(myfile)
  page=doc[0]
  for page in doc:
      text = page.getText(&quot;text&quot;)
      print(text)
  </code></pre>
  <p>when I add another for loop e.g
  <code>for line in page:</code></p>
  <p>I get an error saying page is not iterable. Is there any other way I can do this?</p>
  <p>Thanks</p>