Name

addHeader( ) — add a textual header to a document

Synopsis

$doc->addHeader( text=>$text,
                    font=>$font, 
                    size=>$size, 
                    leading=>$leading  )

The addHeader( ) method allows you to specify a header that will appear at the top of each page of the document. This header will be drawn in the top margin of the page, with the same right and left margins as the page. Only that portion of the header that fits in the top margin will be printed. If the font , size ,or leading attributes are not provided, the default attributes for the TextBlock object are used.

The page numbers of individual pages may be included in the header by the use of the string ##Page within the header’s text string. The ##Page string will be replaced at runtime with the appropriate page number. For example, the following will add the appropriate page number in the upper left corner of each page in the default font, size, and leading:

$doc->addHeader( text => "Page ##Page" );

Get Programming Web Graphics with Perl and GNU Softwar now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.