Header/Footer functionsAdded by IBM on August 8, 2013 | Version 1 (Original)
|This is a collection of functions that can be used within the printsettings option to add header and footer information to a form. These headers and footers do not appear on the screen, but do appear when the form is printed.
Each header and footer can be one or more lines in height. However, they can be no larger than 1/3 of the page size. Each header and footer is also divided into three separate sections: the left, the middle, and the right. By placing text in a particular section, you control where the text is positioned, as follows:
Each section can contain different text. For example, you might put a date in the left section, a title in the middle section, and a page number in the right section.
If you place a long string of text in a header or footer, it will overlap the other sections of that header or footer. For example, suppose you put the following text in the left section of your header:
- Left – The text begins at the left edge of the form.
- Middle – The text is centered in the middle of the form.
- Right – The text is positioned so that it ends at the right edge of the form.
This text would start at the left edge of the form, but would continue to overlap the middle portion of the header. Futhermore, a longer string would also overlap the right portion of the header.
Any hard returns placed in a string are respected. For example, you could avoid overlapping the other sections of the header by using the same string with hard returns, as shown:
This form is for demonstration purposes only. Do not distribute.
If a string is wider than the form, it is truncated appropriately. For example, a string that starts on the left edge of the form is truncated once it reaches the right edge of the form, and vice versa. If a string starts in the middle of the form, it is truncated on both the left and right edges.
Setting the PrintSettings Option
When using the Header/Footer functions, you must include two additional arrays in the printsettings option for the form. The printsettings option should be configured as follows:
This form is for
only. Do not distribute.
The header and footer information are themselves arrays, and should look like this:
All text can be set as normal, using strings, computes, or functions to determine what the text should be.
For more information on configuring the page list and dialog settings, refer to the XFDL Specification.
Pages versus Sheets
Forms often contain multiple pages. These pages are just like the pages of a paper form - you complete one page at a time, and "flip" between the pages (usually with a next or previous page button) while completing the form.
However, when a form is printed, sometimes a single page of the form will be too large to fit on one piece of paper. Since there is no limit to the space you can take up on the computer screen, some form pages may in fact cover many pieces of paper when printed. To make the distinction between a "form page" and the "number of pieces of paper" more clear, we call the pieces of paper "sheets". So, if the first page of a form prints on three pieces of paper, we say that the page covers three sheets.
This distinction is important for numbering, since the Header/Footer functions allow you to number both pages and sheets when printing your form.
Prints the page number of the page currently being printed. Numbering begins from the first page being printed and does not include pages not being printed.
Prints the total number of pages being printed. Numbering begins with the first page being printed, and does not include pages not being printed.
Prints the current date from your computer's system clock.
Prints the page number of the page currently being printed.
Prints the sheet number of the form currently being printed. Each piece of paper used in printing is one "sheet". In this case, numbering begins with the first sheet used to print the current page.
Prints the sheet number of the form currently being printed. Each piece of paper used in printing is one "sheet", and numbering begins with the first piece of paper used to print the form.
Prints the current time from your computer's system clock.
Prints the total number of pages in the form. Numbering begins from the first page of the form, and includes all pages regardless of whether they are being printed.
Prints the total number of sheets necessary to print the current page. Each piece of paper used in printing is one "sheet". Numbering begins with the first sheet used to print the current page.