You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Shiva Kumar <sh...@pawaa.com> on 2015/06/29 07:48:39 UTC

Paragraph Properties of word binary doc are reading wrong from poi

Hi,

I have a doc file which is converted from docx to doc using Microsoft Word.
But when I use WordToHtmlConverter class of poi, some paragraph properties
like indentation, SpacingBefore, SpacingAfter have values zero.

 

    public static void addIndent( Paragraph paragraph, StringBuilder style )

    {

        addIndent( style, "text-indent", paragraph.getFirstLineIndent() );

 

        addIndent( style, "margin-left", paragraph.getIndentFromLeft() );

        addIndent( style, "margin-right", paragraph.getIndentFromRight() );

          System.out.println("spacing before" +
paragraph.getSpacingBefore()); -> 0

        addIndent( style, "margin-top", paragraph.getSpacingBefore() );// it
shows zero

        addIndent( style, "margin-bottom", paragraph.getSpacingAfter() );//
it shows zero

          System.out.println("spacing after" +
paragraph.getSpacingBefore()); -> 0

    }

In the above method which is in WordToHtmlUtils Class of Poi, but I am using
it externally eventhough, the SOP output zero on console, please tell me
what is the problem.

 

I have attached a doc sample which gives this result, both doc and docx
format is attached.

 

Thank You

 

SHIVA KUMAR K R

Phone : +91 9844831440

Linkedin :  <http://in.linkedin.com/in/shivakumarkr/> shiva_kumar_k_r