Skip to content
Advertisement

Apache POI – How to set character spacing for XWPFRun

I need to create an XWPFRun with character spacing expanded by 1 pt. I tried the methods setCharacterSpacing and setKerning but to no avail. I also found no code examples or documentation for either method.

Any advice?

Advertisement

Answer

For me XWPFRun.setCharacterSpacing works. What one needs to know is that the measurement unit is TWIP – twentieths of an inch point. So 1*20 is 1 pt.

Example:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement