title: Footer and external text file usage for phpword
body: <p>More questions on PhpWord class file, examples are not working for me.  I am newly trying to use this and having difficulty even with the samples given.  In this case, I am trying to include a footer on my pages with the page numbers, and then also trying to pull in the content of an external file to display in the document.  </p>
  
  <p>test.txt file just contains only this line of text:</p>
  
  <blockquote>
    <p>This is a test textfile to include in the phpword generated document.</p>
  </blockquote>
  
  <p>Neither show up on the page.  Here is my code:</p>
  
  <pre><code>&lt;?php
  //testing the phpword functionality to get it to output and format correctly
  
  require_once 'includes/vendor/phpoffice/phpword/bootstrap.php';
  
  // Creating the new document...
  $phpWord = new \PhpOffice\PhpWord\PhpWord();
  
  /* Note: any element you append to a document must reside inside of a Section. */
  
  // Adding an empty Section to the document...
  $section = $phpWord-&gt;addSection();
  // Adding Text element to the Section having font styled by default...
  $section-&gt;addText(
      '"Learn from yesterday, live for today, hope for tomorrow. '
      . 'The important thing is not to stop questioning." '
      . '(Albert Einstein)'
  );
  
  /*
   * Note: it's possible to customize font style of the Text element you add in three ways:
   * - inline;
   * - using named font style (new font style object will be implicitly created);
   * - using explicitly created font style object.
   */
  
  // Adding Text element with font customized inline...
  $section-&gt;addText(
      '"Great achievement is usually born of great sacrifice, '
      . 'and is never the result of selfishness." '
      . '(Napoleon Hill)',
      array('name' =&gt; 'Tahoma', 'size' =&gt; 10)
  );
  
  // Adding Text element with font customized using named font style...
  $fontStyleName = 'oneUserDefinedStyle';
  $phpWord-&gt;addFontStyle(
      $fontStyleName,
      array('name' =&gt; 'Tahoma', 'size' =&gt; 10, 'color' =&gt; '1B2232', 'bold' =&gt; true)
  );
  $section-&gt;addText(
      '"The greatest accomplishment is not in never falling, '
      . 'but in rising again after you fall." '
      . '(Vince Lombardi)',
      $fontStyleName
  );
  
  // Adding Text element with font customized using explicitly created font style object...
  $fontStyle = new \PhpOffice\PhpWord\Style\Font();
  $fontStyle-&gt;setBold(true);
  $fontStyle-&gt;setName('Tahoma');
  $fontStyle-&gt;setSize(13);
  $myTextElement = $section-&gt;addText('"Believe you can and you\'re halfway there." (Theodor Roosevelt)');
  $myTextElement-&gt;setFontStyle($fontStyle);
  
  $footer = $section-&gt;addFooter();
  $footer-&gt;addPreserveText('Page {PAGE} of {NUMPAGES}.', null, array('alignment' =&gt; \PhpOffice\PhpWord\SimpleType\Jc::CENTER));
  $section-&gt;addPageBreak();
  
  //get an external text file to display
  $filename = "test.txt";
  $textfile = \PhpOffice\PhpWord\IOFactory::load($filename);
  $section-&gt;addText($textfile);
  
  $objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'RTF');
  $objWriter-&gt;save('testdoc.rtf');
  
  ?&gt;
  </code></pre>
  
  <p>Thanks.  I'd really like to get this working or find another open source solution that works better.  </p>