How to read font size of each word in a word document using POI?

后端 未结 1 590
隐瞒了意图╮
隐瞒了意图╮ 2021-01-12 20:02

I am trying to find out whether there exist anything in the word document that has a font of 2. However, I have not been able to do this. To begin with, I\'ve tried to read

相关标签:
1条回答
  • 2021-01-12 20:12

    Yes, that's the correct way; the measurement is in half points.

    In a docx, you'd have something like:

    <w:rPr>
    
      <w:sz w:val="28" /> 
    
    </w:rPr>
    

    ECMA 376 spec on @sz defines the unit as ST_HpsMeasure (Measurement in Half-Points)

    Its the same with the binary doc format, which HWPF supports. If you look at [MS-DOC], you'll see it also specifies the size of text in half-points.

    0 讨论(0)
提交回复
热议问题