私は答えに私を導いたサンプルコードhereが見つかりました:
#! /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"
マスターページのスタイルは、ドキュメントのルックアンドフィールを定義する - CSSを考えます。どうやら 'Standard'は、OpenOfficeによって作成されたドキュメントのマスターページスタイルのデフォルト名です。これは、ラップで落ちたサンプルコードを見つけたら、ひどいナットでした。
完全な答えはわかりませんが、.odtファイルを解凍すると 'content.xml'というファイルが作成されます。 xmlを見ると(xmltidyの使用が助かります)。これにより、odfドキュメントの構造が表示されます。 OpenOffice :: OODocオブジェクト内のデータ構造は、xmlのxpath構造を反映しています。ヘッダー内のテキストを見つけて、その周りのタグを読んでください。OODocオブジェクトでどこを探すべきかを理解できるはずです。 –
私はOpenOffice :: OODoc :: Text perldocを見ただけで、 "styles.xml"にヘッダとフッタを定義できると述べています。 –