You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by JavaDev <pa...@gmail.com> on 2012/02/08 18:33:31 UTC

Re: XWPF Sections

Hi Mark,

Can you let me know which version of POI this code was built on? Also, I
need to get the Header/Footer margin size from a word document, can you help
me with this?


Regards,
Pankaj

--
View this message in context: http://apache-poi.1045710.n5.nabble.com/XWPF-Sections-tp4313854p5467137.html
Sent from the POI - User mailing list archive at Nabble.com.

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


Re: XWPF Sections

Posted by JavaDev <pa...@gmail.com>.
I downloaded & added the ooxml 1.1 jar and code executed without any issues. 

Thanks a ton to both of you - Dave and Mark.


Regards,
Pankaj

--
View this message in context: http://apache-poi.1045710.n5.nabble.com/XWPF-Sections-tp4313854p5467520.html
Sent from the POI - User mailing list archive at Nabble.com.

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


Re: XWPF Sections

Posted by Dave Fisher <da...@comcast.net>.
On Feb 8, 2012, at 11:24 AM, JavaDev wrote:

> Hi Mark,
> 
> Thanks for your reply. I have been playing around with your code and it is
> very helpful. Reason, I asked the version is "sectPr.getPgMar()" calls a
> method of class "CTPageMgr", but I cannot find this class in any poi-ooxml
> jar files of any poi version - 3.8 or 3.7. So, it is throwing me exception
> on execution. 

Please see this FAQ: http://poi.apache.org/faq.html#faq-N10025

You need to use the full ooxml-schemas-1.1.jar

Regards,
Dave

> 
> However, I did find another class "CTPageMargins", but don't understand how
> to initialize it, to get the same properties as the other one. Moreover, I
> am not even sure if the former class has been replaced by the latter.
> 
> Any help with this is highly appreciated.
> 
> 
> Regards,
> Pankaj
> 
> 
> 
> --
> View this message in context: http://apache-poi.1045710.n5.nabble.com/XWPF-Sections-tp4313854p5467451.html
> Sent from the POI - User mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> 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


Re: XWPF Sections

Posted by JavaDev <pa...@gmail.com>.
Hi Mark,

Thanks for your reply. I have been playing around with your code and it is
very helpful. Reason, I asked the version is "sectPr.getPgMar()" calls a
method of class "CTPageMgr", but I cannot find this class in any poi-ooxml
jar files of any poi version - 3.8 or 3.7. So, it is throwing me exception
on execution. 

However, I did find another class "CTPageMargins", but don't understand how
to initialize it, to get the same properties as the other one. Moreover, I
am not even sure if the former class has been replaced by the latter.

Any help with this is highly appreciated.


Regards,
Pankaj



--
View this message in context: http://apache-poi.1045710.n5.nabble.com/XWPF-Sections-tp4313854p5467451.html
Sent from the POI - User mailing list archive at Nabble.com.

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


Re: XWPF Sections

Posted by Mark Beardsley <ma...@tiscali.co.uk>.
Sorry to say this but I do not really know. Looking at the date of the post,
it could have been version 3.7 but I cannot really be sure. Somewhere, I may
have the original project file and will see if I can search it out and find
out the names of the archives I bound to that but cannot offer any promises.
If I do find anything out, I will post again.

Yours

Mark B

PS. It should be possible to replicate this code using the latest version of
the api. Judging from the post that immediately precedes yours, the
interface offered by the CTSectPr class may have changed but I cannot
believe that it is impossible to get at the same information. Have you tried
playing with an instance of that calss in an IDE to see what methods you are
offered?

--
View this message in context: http://apache-poi.1045710.n5.nabble.com/XWPF-Sections-tp4313854p5467186.html
Sent from the POI - User mailing list archive at Nabble.com.

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