The IlvPrintableDocument Class

The IlvPrintableDocument class manages a list of printable objects. It uses iterators to sequence through the printable objects. It provides a default layout, but each printable can specify its own layout.

Multiple copies of the document can be printed using two modes:

  • The whole document is printed n times.

  • Each page is printed n times, then the next page is printed.

Iterators

Iterators are instances of the inner class IlvPrintableDocument::Iterator. The most used are returned by the following IlvPrintableDocument methods:

  • end() const; iterators are then used like any other variable.

Example

IlvPrintableDocument document;

// add some printables to the document

document.append(new IlvPrintableContainer(container);

.....

// the iterate through the printables

IlvPrintableDocument::Iterator begin = document.begin();

IlvPrintableDocument::Iterator end = document.end();

 

for (IlvPrintableDocument::Iterator iter = document.begin();

iter != end;

++iter) {

// do something with the printable.

IlvPrintable* printable = iter.getPrintable();

 

}