The ImageGear printing API includes classes that allow the application to print various information on a page header and footer. This information can include text strings, page number and page count, or other application-defined fields.
The PagePrintSettings Class has the PrintFields property, which contains a collection of print fields. Each print field is defined by its position (header/footer, left/center/right) and its content.
SimpleTextPrintFieldContent contains a text string and font attributes. The application can initialize print field content before printing, and add a PrintField with this content to the PrintJob. The PrintJob object will print this field on each page of the document.
The application can also modify print fields before printing each page, by providing a custom copy of the PagePrintSettings Class to PrintJob.RenderPage method.
PageNumberPrintFieldContent prints a page number, and optionally, page count. The PrintJob object updates its text automatically during printing, according to the currently printed page number.
If several print fields reference the same location, ImageGear concatenates them from left to right, in order of occurrence in the collection, and then places them in the specified location on the page.
The PrintPreview.PrintFieldOptions property allows the application to specify possible content for print fields. The control allows the user to select content for each of the 6 available locations on the page: header left, header center, header right, footer left, footer center, and footer right.
Print fields are rendered in the top and bottom margins of the page. If the height of the margin is less than the height of the print field content, the print field is clipped by height.