title: Docx4j java.lang.UnsupportedOperationException: No ImageHandler available for image when converting from docx to pdf
body: <p>I am using Docx4j to first create a .docx file (working as intended), then convert the docx file to pdf using Docx4j.toFO(). The file contains images, and is throwing this stack trace when executed.</p>
  
  <pre><code>org.docx4j.openpackaging.exceptions.Docx4JException: Exception exporting package
      at org.docx4j.convert.out.common.AbstractExporter.export(AbstractExporter.java:97) ~[docx4j-3.1.0.jar:na]
      at org.docx4j.Docx4J.toFO(Docx4J.java:475) ~[docx4j-3.1.0.jar:na]
  </code></pre>
  
  <p>...</p>
  
  <pre><code>Caused by: java.lang.UnsupportedOperationException: No ImageHandler available for image: file:/usr/tomcat/apache-tomcat-7.0.62/temp/df7fc224-b424-4083-9b85-45032b5ff6e5image1.png (image/png) (org.apache.xmlgraphics.image.loader.impl.ImageRawStream)
      at org.apache.fop.render.intermediate.AbstractIFPainter.drawImage(AbstractIFPainter.java:218) ~[fop-1.0.jar:na]
  </code></pre>
  
  <p>Relevant POM.xml entries:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.docx4j&lt;/groupId&gt;
      &lt;artifactId&gt;docx4j&lt;/artifactId&gt;
      &lt;version&gt;3.2.2&lt;/version&gt;
      &lt;scope&gt;provided&lt;/scope&gt; 
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;xalan&lt;/groupId&gt;
      &lt;artifactId&gt;xalan&lt;/artifactId&gt;
      &lt;version&gt;2.7.2&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;org.apache.xmlgraphics&lt;/groupId&gt;
      &lt;artifactId&gt;fop&lt;/artifactId&gt;
      &lt;version&gt;2.1&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>FOSettings foSettings = Docx4J.createFOSettings();
  
  String outputfilepath = System.getProperty("java.io.tmpdir") + "/form.pdf";         
  
  OutputStream os = new java.io.FileOutputStream(outputfilepath);
  
  foSettings.setWmlPackage(wordMLPackage);
  
  if (foSettings.getImageHandler() == null) {
      logz.debug("Image handler is null");
      foSettings.setImageHandler(foSettings.getImageDirPath() != null ? 
              new FOConversionImageHandler(foSettings.getImageDirPath(), true) : 
              new FOConversionImageHandler());
  }
  
  Docx4J.toFO(foSettings, os, Docx4J.FLAG_EXPORT_PREFER_XSL);
  </code></pre>