CPAN::Forum
OpenOffice-OODoc - Re: Accessing contents of headers and footers
| Posted on Sat Sep 17 00:59:07 2005 by jmgdoc in response to 988 (See the whole thread of 3) |
| Re: Accessing contents of headers and footers |
|
Caution ! Up to 2.007, getHeaderParagraph() and getFooterParagraph() are buggy. They work in 2.008, to be released soon (it's a matter of days, maybe hours). But your code will never work as is. The first argument og getPageHeader() is a master page, not a page number. In text documents, the printable pages are dynamically generated by the office software; they are not persistent objects stored in the files. Headers and footers belong to page masters (which are persistent objects, used by the rendering software to dynamically build the printable pages). Knowing that object numeric positions are zero-based, the number of the 1st patragraph is 0. In addition, the master pages are generally described in the 'styles' workspace (neither in 'content' not in 'meta'). So, in order to get, say, the 1st paragraph of the header of the "Standard" (default) master page, you can write:
my $para = $doc->getHeaderParagraph("Standard", 0);
But you should wait 2.008 to try that. Last remark: print $para will never print the text of the paragraph. getParagraphHeader() returns a paragraph element, which is a text container and not a text content. To print the content you should use write something like
print $doc->getText($para);
|
| Write a response |
(4)
]