You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by Stefano Errani <st...@immobiportal.com> on 2017/04/15 14:23:11 UTC

How can I do to justify a text in a paragrath?

Good day.

I'm using Apache POI 3.15 version in order to create a Microsoft Word document in Java.
I cannot found a way in order to justify a text in a paragraph.
In XWPFParagraph class I found only BOTH (of ParagraphAlignment class), but with it, if the are a few words in a line it adds several spaces between the words and this is very wrong.
How can I do to make it?

Best regards.

Stefano Errani

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


RE: How can I do to justify a text in a paragrath?

Posted by "Murphy, Mark" <mu...@metalexmfg.com>.
Give an example of the code and the XML it produces. This is the XML Word 2016 produces:

<w:body>
  <w:p>
    <w:pPr>
      <w:jc w:val="both"/>
    </w:pPr>
    <w:r>
      <w:t>This is a test</w:t>
    </w:r>

The line does not add a bunch of spaces to get the last word on the last line over to the right margin.

-----Original Message-----
From: Stefano Errani [mailto:stefano.errani@immobiportal.com] 
Sent: Saturday, April 15, 2017 10:23 AM
To: dev@poi.apache.org
Subject: How can I do to justify a text in a paragrath?

Good day.

I'm using Apache POI 3.15 version in order to create a Microsoft Word document in Java.
I cannot found a way in order to justify a text in a paragraph.
In XWPFParagraph class I found only BOTH (of ParagraphAlignment class), but with it, if the are a few words in a line it adds several spaces between the words and this is very wrong.
How can I do to make it?

Best regards.

Stefano Errani

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org For additional commands, e-mail: dev-help@poi.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org