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/07/02 07:13:01 UTC

paragraph.spacingBefore() is returning 0 for binary DOC file.

Hi, I asked this question before but I did not got any response, I think
this is a bug. In this below code I am reading paragraph properties from a
DOC which was DOCX file converted to DOC from Word 2007 application.

 

I have attached the DOC sample and the code to test the paragraph
properties. Below is the sample portion from it.

 

THE PROBLEM IS : the values of some paragraphs are not at all zero but
paragraph object returns 0 value. Why?

 

int ps = s.numParagraphs();// s-> section object

                                                                Paragraph
paragraph;

                                                                for (int j =
0; j < ps; j++) {

 
paragraph = s.getParagraph(j);

 
int spacebfr = paragraph.getSpacingBefore();

 
if(spacebfr == 24)

 
System.out.println("returning correct value");

 
int spaceafr = paragraph.getSpacingAfter();

 
if(spaceafr == 8)

 
System.out.println("returning correct value");

                                                                }

 

 

Thank You

 

SHIVA KUMAR K R

Phone : +91 9844831440

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

 


Re: paragraph.spacingBefore() is returning 0 for binary DOC file.

Posted by Dominik Stadler <do...@gmx.at>.
Obviously nobody knows the answer right away so unfortunately your
only possibility will be to debug this and look at the source code to
find out where the information is in the objects and why it is not
returned correctly.

Dominik.

On Thu, Jul 2, 2015 at 7:13 AM, Shiva Kumar <sh...@pawaa.com> wrote:
> Hi, I asked this question before but I did not got any response, I think
> this is a bug. In this below code I am reading paragraph properties from a
> DOC which was DOCX file converted to DOC from Word 2007 application.
>
>
>
> I have attached the DOC sample and the code to test the paragraph
> properties. Below is the sample portion from it.
>
>
>
> THE PROBLEM IS : the values of some paragraphs are not at all zero but
> paragraph object returns 0 value. Why?
>
>
>
> int ps = s.numParagraphs();// s-> section object
>
>                                                                 Paragraph
> paragraph;
>
>                                                                 for (int j =
> 0; j < ps; j++) {
>
>
> paragraph = s.getParagraph(j);
>
>
> int spacebfr = paragraph.getSpacingBefore();
>
>
> if(spacebfr == 24)
>
>
> System.out.println("returning correct value");
>
>
> int spaceafr = paragraph.getSpacingAfter();
>
>
> if(spaceafr == 8)
>
>
> System.out.println("returning correct value");
>
>                                                                 }
>
>
>
>
>
> Thank You
>
>
>
> SHIVA KUMAR K R
>
> Phone : +91 9844831440
>
> Linkedin : shiva_kumar_k_r
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org

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