Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7744927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:53:09+00:00 2026-06-01T09:53:09+00:00

How do you get elements in a header/footer of a odt doc? for example

  • 0

How do you get elements in a header/footer of a odt doc?

for example I have:

use OpenOffice::OODoc;    
my $doc = odfDocument(file => 'whatever.odt');
    my $t=0;
    while (my $table = $doc->getTable($t))
    {
       print "Table $t exists\n";
       $t++;
    }

When I check the tables they are all from the body. I can’t seem to find elements for anything in the header or footer?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T09:53:10+00:00Added an answer on June 1, 2026 at 9:53 am

    I found sample code here which led me to the answer:

    #! /usr/local/bin/perl
    
    use OpenOffice::OODoc;
    
    my $file='asdf.odt';
    
    # odfContainer is a representation of the zipped odf file 
    # and all of its parts.
    my $container = odfContainer("$file");
    
    # We're going to look at the 'style' part of the container,
    # because that's where the header is located.
    my $style = odfDocument
        (
        container => $container,
        part      => 'styles'
        );
    
    # masterPageHeader takes the style name as its argument.
    # This is not at all clear from the documentation.
    my $masterPageHeader = $style->masterPageHeader('Standard');
    my $headerText = $style->getText( $masterPageHeader );
    
    print "$headerText\n"
    

    The master page style defines the look and feel of the document — think CSS. Apparently ‘Standard’ is the default name for the master page style of a document created by OpenOffice… that was the toughest nut to crack… once I found the example code, that fell out in my lap.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does clojure have a powerful 'loop' like common lisp. for example: get two elements
I have the following setup to get a layout with header and footer. Since
I have 4 arraylist in jsp and I want to get elements of lists
I'm trying to get the elements in an HTML doc that contain the following
I have the string SUM([A2:A10],[B2:B10],[C2:C10],[D2:D10]) and I need to get the elements [A2:A10],[B2:B10],[C2:C10],[D2:D10] in
I have 2 #header elements with different info in each that I want to
There is a strange border on my fixed header and footer elements in firefox..
I have a page with a variable-height header, content area, and footer. I want
I have two elements on my form - textarea and file element for file
I have a html page. With header Body and Footer. In Body I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.