You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Nick Burch <ni...@alfresco.com> on 2011/05/03 04:03:52 UTC

Re: Landscape format for a word document - XWPFDocument

On Fri, 29 Apr 2011, Dmitry Kochelaev wrote:
> XPath inside document.xml is /document/body/sectPr/pgSz. Inside XWPFDocument
> class this can be change with following call:
> ctDocument.getBody().getSectPr().getPgSz().setOrient(STPageOrientation.LANDSCAPE);
>
> I think of sending patch to community

If you could, that'd be great. Open a new bug on bugzilla, with [PATCH] in 
the title, and upload the patch. I guess this would want to be a new 
method on XWPFDocument to toggle between landscape and portrait. If you 
can, include a getter too!

Cheers
Nick

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


Re: Landscape format for a word document - XWPFDocument

Posted by Mark Beardsley <ma...@tiscali.co.uk>.
Nick, I thought about this myself but there is a slight problem; it is
possible to set the page orientation for each section within the document. I
do not know if this depends upon the section's type, although I am going to
guess that it might as sections can be continuous, next page, etc. Playing
around with sections earlier, I found that the last or only section is bound
to the document - the CTSectPr object can be obtained from the document -
whereas the final paragraph in each section is the attachment point fore th
CTSectPr object that applies to a specific section.

Hope this helps.

Yours

Mark B

--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Landscape-format-for-a-word-document-XWPFDocument-tp4346297p4366498.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