Posted on 2009-05-25 17:19:43-07 by csanchez
How to get Page Headers
Hi, I have an odf document with a header containing a table, this header is the same in all the document but the first page. I can't get the table with the getTable method in OODoc::Text, this table have the name "TabHead". How can I get the content of this table and set the content of it? Thanks for the help.
Direct Responses: 10817 | Write a response
Posted on 2009-05-25 19:03:33-07 by jmgdoc in response to 10812
Re: How to get Page Headers

Page headers and footers belong to page style definitions (i.e. master pages). So an object that belong to a page header is defined in the "styles" part of the ODF container, and not in the "content" part (which is the default part unless the part option is not provided).
A table whose name is "TabHead" can be retrieved with getTable("TabHead"), but the context should be "styles" instead of "content". Ex:
$doc = odfDocument(file => "myfile.odt", part => "styles"); $table = $doc->getTable("TabHead");
Have a look at the "Dealing with styles an content" section in the OpenOffice::OODoc::Intro page for details regarding applications that need access to more than one document part in the same session (typically styles and content).
Direct Responses: 10820 | Write a response
Posted on 2009-05-26 04:23:51-07 by csanchez in response to 10817
Re: How to get Page Headers
Thanks a lot, it works perfectly! Regards.
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.