|
Introduction
qPrinterē Documents are constructed by adding
different objects (text and images) to the document. When
qPrinterē prints or previews the document, it calculates the
position and size of each object, taking into account styles,
indenting and border properties. It allows the coder to change
text or images in the document without having to recreate the
document.
Each Page of a Document is split into 3 areas:
Header, Footer and Body.
|
|
Headers and Footers are
optional. The Body of the document will fit
appropriately between the Header and Footer for each
page. Where there are no Headers or Footers the body
will start and end at the top and bottom of the page.
The Body of the Document is split between Absolute items
and TextFlow items. Absolute items can have their
position set to specific coordinates and can either be printed
on a specific page or on all pages. Absolute items are
always printed before TextFlow items on a page.
TextFlow items are presented in the document one after the
other in the order they are held in the Document object.
qPrinterē calculates the size of each item in order to
measure which page and where on the page the TextItem will be
positioned. |
Vertical Alignment
The
vertical alignment of TextFlow items can be set so that following
items start at the same position. This allows columns and
tables to be constructed.
In the diagram, the first example shows three items
that have the VAlignNextItem set to False. Block 2 is
positioned vertically below Block 1 and Block 3 is positioned below
Block 2.
In the second example Block 1 and Block 2 have
their VAlignNextItem property set to True. Block 3 has the
same property set to False, otherwise the next item would also be
presented at the same vertical position.
Where Document items are vertically aligned,
qPrinterē will calculate the tallest item and position the next
non-aligned item below the tallest item.
Keeping Items together on a Page
It is possible to ensure that items are kept
together using the 'KeepWithNext' property. When this property
is set to True, qPrinterē will start a new page if it cannot fit
all the 'KeepWithNext' items on the current page. Where the
height of the grouped items is taller than the page, qPrinterē will
present them as if the value had not been set. This is to
ensure that blank pages are not included. By combining the
VAlignNextItem and KeepWithNext properties you can create a table
and ensure it is printed entirely on a page.
|