You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by Robert Paris <rp...@hotmail.com> on 2005/03/31 19:00:55 UTC

Question on Complex File Testing

Can anyone tell me how I can create a complex Word file (i.e. fast-saved) 
for testing? I can't figure out how it gets created.

Thanks!



---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/


RE: Question on Complex File Testing

Posted by Robert Paris <rp...@hotmail.com>.
>Word sometimes decides to save in "fast-save" mode when it feels like it.

You mean it's non-standard? :8O <-- Big look of shock! I don't believe it! 
LOL.

Thanks! I'll give that a try.



---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/


RE: Trying to understand PAPX Code

Posted by Robert Paris <rp...@hotmail.com>.
Hey I think I found the problem, and it wasn't what I mentioned before.

in PAPFormattedDiskPage, right after the code to get the size of the 
PAPX/GRPPRL, the code creates a new papx byte array and then populates it 
starting with THE NEXT BYTE! That's wrong! The next byte should be the istd.

so the code:
[WRONG-CODE]
       if(size == 0)
       {
           size = 2 * LittleEndian.getUnsignedByte(_fkp, _offset + 
++papxOffset);
       }
       else
       {
           size--;
       }

       byte[] papx = new byte[size];
       System.arraycopy(_fkp, _offset + ++papxOffset, papx, 0, size);
[/WRONG-CODE]

Should read:
[CORRECT-CODE]
       if(size == 0)
       {
           size = 2 * LittleEndian.getUnsignedByte(_fkp, _offset + 
++papxOffset);
       }
       else
       {
           size--;
       }

       //HERE'S THE CHANGE
       byte istd = _fkp[ ++papxOffset ]; //THIS MOVES IT FORWARD PAST THE 
istd BYTE

       byte[] papx = new byte[size];
       System.arraycopy(_fkp, _offset + ++papxOffset, papx, 0, size);
[/CORRECT-CODE]

This fixes my problem where I was getting SprmType's of 0. They're now all 
valid. I hope this helps!




>From: "Robert Paris" <rp...@hotmail.com>
>Reply-To: "POI Developers List" <po...@jakarta.apache.org>
>To: poi-dev@jakarta.apache.org
>Subject: Trying to understand PAPX Code
>Date: Fri, 08 Apr 2005 05:09:46 +0000
>
>Can someone explain this to me?
>
>In the code for getting the PAPX (getGrpprl of PAPFormattedDiskPage), the 
>following code is used to determine the size of the PAPX:
>
>[CODE]
>       int papxOffset = 2 * LittleEndian.getUnsignedByte(_fkp, _offset + 
>(((_crun + 1) * FC_SIZE) +
>                               (index * BX_SIZE)));
>       int size = 2 * LittleEndian.getUnsignedByte(_fkp, _offset + 
>papxOffset);
>       ..other code elided ..
>[/CODE]
>
>What I don't understand is the papxOffset code and the size code. As I 
>understand the documentation, the first byte of the PAPX (since we're in an 
>FKP here) holds the count of words for this PAPX. So why isn't the 
>papxOffset simply:
>
>       int papxOffset = _offset + ( ( ( _crun + 1 ) * FC_SIZE ) + ( index * 
>BX_SIZE ) ) ) + 1;
>
>I don't understand why you're getting the last byte of the BX's and then 
>multiplying that value by 2. I don't see where in the documentation it says 
>that the byte at that spot is something that indicates our offset for the 
>PAPX's. (I may be missing something)
>
>I ask because in using the above code, I keep getting weird values, such as 
>my sprm types keep coming up as 0, which of course is not a valid type. Can 
>someone explain the above code to me?
>
>Thank you very much for any help you guys can give!
>
>Robert
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
>Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
>The Apache Jakarta POI Project: http://jakarta.apache.org/poi/
>



---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/


Trying to understand PAPX Code

Posted by Robert Paris <rp...@hotmail.com>.
Can someone explain this to me?

In the code for getting the PAPX (getGrpprl of PAPFormattedDiskPage), the 
following code is used to determine the size of the PAPX:

[CODE]
       int papxOffset = 2 * LittleEndian.getUnsignedByte(_fkp, _offset + 
(((_crun + 1) * FC_SIZE) +
                               (index * BX_SIZE)));
       int size = 2 * LittleEndian.getUnsignedByte(_fkp, _offset + 
papxOffset);
       ..other code elided ..
[/CODE]

What I don't understand is the papxOffset code and the size code. As I 
understand the documentation, the first byte of the PAPX (since we're in an 
FKP here) holds the count of words for this PAPX. So why isn't the 
papxOffset simply:

       int papxOffset = _offset + ( ( ( _crun + 1 ) * FC_SIZE ) + ( index * 
BX_SIZE ) ) ) + 1;

I don't understand why you're getting the last byte of the BX's and then 
multiplying that value by 2. I don't see where in the documentation it says 
that the byte at that spot is something that indicates our offset for the 
PAPX's. (I may be missing something)

I ask because in using the above code, I keep getting weird values, such as 
my sprm types keep coming up as 0, which of course is not a valid type. Can 
someone explain the above code to me?

Thank you very much for any help you guys can give!

Robert



---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/


How figure out footnote mark? (If not auto-generated)

Posted by Robert Paris <rp...@hotmail.com>.
I've been able to properly grab all footnotes and place them properly in the 
text. Also, when auto-generated, I'm able to get the number for the 
footnote. However, when the footnote uses a custom-mark, I can't figure out 
where to get the info on the length of the mark (since it's simply included 
in front of the text for that footnote in the footnote text located at fcMin 
+ ccpText).

Does anyone know how to figure out what a footnote's custom mark is?

Thanks!



---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/


How figure out footnote mark? (If not auto-generated)

Posted by Robert Paris <rp...@hotmail.com>.
I've been able to properly grab all footnotes and place them properly in the 
text. Also, when auto-generated, I'm able to get the number for the 
footnote. However, when the footnote uses a custom-mark, I can't figure out 
where to get the info on the length of the mark (since it's simply included 
in front of the text for that footnote in the footnote text located at fcMin 
+ ccpText).

Does anyone know how to figure out what a footnote's custom mark is?

Thanks!



---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/


RE: Question on Complex File Testing

Posted by Kais Dukes <k....@complexar.com>.
Hi Robert,

Make sure that "fast-save" is turned on Microsoft Word. Then, keep making
adjustments to a document, and resaving. Word sometimes decides to save in
"fast-save" mode when it feels like it.

Regards,

Kais Dukes

-----Original Message-----
From: Robert Paris [mailto:rpjava@hotmail.com]
Sent: 31 March 2005 18:01
To: poi-dev@jakarta.apache.org
Subject: Question on Complex File Testing


Can anyone tell me how I can create a complex Word file (i.e. fast-saved)
for testing? I can't figure out how it gets created.

Thanks!



---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.859 / Virus Database: 585 - Release Date: 14/02/2005

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.859 / Virus Database: 585 - Release Date: 14/02/2005


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/