CPAN::Forum
OpenOffice-OODoc - Re: Working with headers and footers
| Posted on Thu Nov 16 21:51:56 2006 by jmgdoc in response to 3540 (See the whole thread of 2) |
| Re: Working with headers and footers |
|
Hi, The first issue is here:
my $footer = $s->createParagraph("- ",style=>"Footer");
The target document is a new one which has just been built by ooDocument() using the "create" option. So, there is no predefined "Footer" style in it. This behaviour could be changed by using custom templates instead of the basic templates provided with the OpenOffice::OODoc CPAN distribution, but the right solution is much simpler: you have just to create a custom paragraph style with the appropriate text alignment property:
$s->createStyle
(
"CustomCenteredFooter",
family = "paragraph",
properties =>
{
"fo:text-align" => "center"
}
);
The new "CustomCentered" style name is ready for use as the style option for the footer paragraph. About the table in the header: Creating a table in a header from scratch is possible, but not recommended (and the explanation is a bit tricky). When a rich presentation is needed, the best option consists of using a template document, bringing the appropriate style definitions (including table prototypes and page styles), instead of creating the document from scratch. About the page break question: The "style" option of setPageBreak(), if set, must provide an arbitrary but unique name, which must differ from any existing style name. If the existing paragraph style is a named style (i.e. a style which will appear in the stylist dialog box of OpenOffice.org), this option is mandatory. It should be omitted otherwise. Details about setPageBreak() are provided in the OpenOffice::OODoc::Document manual page. |
| Write a response |
(4)
]