21.08.2013 Views

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

More Than Just Text 119<br />

PageNumber =<br />

Doc.createInstance("com.sun.star.text.textfield.PageNumber")<br />

PageNumber.NumberingType = com.sun.star.style.NumberingType.ARABIC<br />

PageStyles = Doc.StyleFamilies.getByName("PageStyles")<br />

StdPage = PageStyles("Default")<br />

StdPage.FooterIsOn = True<br />

FooterCursor = StdPage.FooterTextLeft.Text.createTextCursor()<br />

StdPage.FooterTextLeft.Text.insertTextContent(FooterCursor, PageNumber,<br />

False)<br />

The example first creates a text field which supports the<br />

com.sun.star.text.textfield.PageNumber<br />

service. Since the header and footer lines are defined as part of the page templates of<br />

<strong>OpenOffice</strong>.<strong>org</strong>, this is initially established using the list of all PageStyles.<br />

To ensure that the footer line is visible, the FooterIsOn property is set to True. The text<br />

field is then inserted in the document using the associated text object of the left-hand footer<br />

line.<br />

Annotations<br />

Annotation fields (<br />

com.sun.star.text.textfield.Annotation<br />

) can be seen by means of a small yellow symbol in the text. Clicking on this symbol opens a<br />

text field, in which a comment on the current point in the text can be recorded. An<br />

annotation field has the following properties.<br />

Author (String)<br />

name of author.<br />

Content (String)<br />

comment text.<br />

Date (Date)<br />

date on which annotation is written.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!