title: how to add a picture to a .docx document with Apache POI XWPF in java
body: <p>I've created a simple docx-Document, using Java POI 3.7. XWPF. Then, I added a picture by 
  using the Method  <code>XWPFDocument.addpicture(byte[] arg0, int arg1)</code>. </p>
  
  <pre><code>XWPFDocument docx = new XWPFDocument();  
  XWPFParagraph par = docx.createParagraph();  
  XWPFRun run = par.createRun();
  run.setText("Hello, World. This is my first java generated docx-file. Have fun.");
  run.setFontSize(13);
  
  InputStream pic = new FileInputStream("logo.jpg");
  byte [] picbytes = IOUtils.toByteArray(pic);
  docx.addPicture(picbytes, Document.PICTURE_TYPE_JPEG);
  </code></pre>
  
  <p>Since file size of the docx grows, the picture was added "physically" to the document; but it is not displayed at all in MS Word. Seems like there is a reference to the picture missing in the document.</p>
  
  <p>What's the way to do this? How is picture handling done with apache POI? And where are more tutorials on the web, there is nearly no documents or tutorials at all for XWPF, which explains handling of paragraphs, runs, etc.</p>
  
  <p>The only thing I found about this is here: <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=49765">https://issues.apache.org/bugzilla/show_bug.cgi?id=49765</a> but it does not help at all.</p>
  
  <p>Many thanks in advance.</p>