title: Converting docx to pdf with phpword
body: <p>I want to convert a docx file to pdf using <a href="https://github.com/PHPOffice/PHPWord" rel="nofollow noreferrer">phpword</a></p>
  
  <p>my code looks like this:</p>
  
  <pre><code>$FilePath = APPPATH."media/Documentos/Facturas/Factura ".$FacturaId.".docx";
  $FilePathPdf = APPPATH."media/Documentos/Facturas/Factura ".$FacturaId.".pdf";
  
  //DOCX TO PDF
  require_once APPPATH.'third_party/phpword/bootstrap.php';
  
  $rendererLibraryPath = PHPWORD_BASE_DIR . '/vendor/dompdf/dompdf';
  \PhpOffice\PhpWord\Settings::setPdfRendererPath($rendererLibraryPath);
  \PhpOffice\PhpWord\Settings::setPdfRendererName('DomPDF');
  
  $phpWord = new \PhpOffice\PhpWord\PhpWord();
  
  //Load temp file
  $phpWord = \PhpOffice\PhpWord\IOFactory::load($FilePath);
  
  //Save it
  $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord , 'PDF');
  $xmlWriter-&gt;save($FilePathPdf, true);
  </code></pre>
  
  <p>But i generate an empty pdf file: <a href="https://drive.google.com/open?id=0B28-zcTndIM9cjQwTWFTVDhIaFU" rel="nofollow noreferrer">LINK TO FILE</a></p>
  
  <p>Paths are correct and .docx have content</p>
  
  <p>I try with tcpdf render:</p>
  
  <pre><code>$rendererLibraryPath = PHPWORD_BASE_DIR . '/vendor/tecnickcom/tcpdf';
  \PhpOffice\PhpWord\Settings::setPdfRendererPath($rendererLibraryPath);
  \PhpOffice\PhpWord\Settings::setPdfRendererName('TCPDF');
  </code></pre>
  
  <p>and my pdf file have 2 pages without content: <a href="https://drive.google.com/open?id=0B28-zcTndIM9R2gwUEF6TGtWbm8" rel="nofollow noreferrer">LINK TO 2ND FILE</a></p>