title: How to get font size of paragraph from docx document using apache POI?
body: <p>I have a MS-Word document in docx format. I want to get font size of each paragraph or line. I tried looking similar approach used <a href="https://stackoverflow.com/questions/17584413/how-to-read-font-size-of-each-word-in-a-word-document-using-poi">here</a> for docx file on apache POI documentation page but could not found one.</p>
  
  <p>I tried this approach but it is giving <code>-1 as font size</code> and <code>font-name as null</code>. </p>
  
  <pre><code>File file = new File(fileName);
  FileInputStream fis = new FileInputStream(file.getAbsolutePath());
  
  XWPFDocument document = new XWPFDocument(fis);
  List&lt;XWPFParagraph&gt; paragraphs = document.getParagraphs();
  
  System.out.println("Total no of paragraph in Docx : "+paragraphs.size());
  for (XWPFParagraph para : paragraphs) {
      XWPFStyle style = document.getStyles().getStyle(para.getStyleID());
      System.out.println(para.getText());
      int pos = 0;
      for (XWPFRun run : para.getRuns()) {
        System.out.println("Current run IsBold : " + run.isBold());
        System.out.println("Current run IsItalic : " + run.isItalic());
        System.out.println("Current Font Size : " + run.getFontSize());
        System.out.println("Current Font Name : " + run.getFontName());
      }
    }
    fis.close();
  </code></pre>
  
  <p><strong>Update:</strong> I found <a href="https://stackoverflow.com/a/30095858/5381204">this</a>, but could not manage to get font size.</p>
  
  <p>Thanks in advance.</p>