/**
* Create a book. A book contains a pair of page painters called printables.
* Also you have different pageformats.
*/
Book book = new Book();
/**
* Append the Printable Object (this one itself, as it implements a
* printable interface) and the page format.
*/
book.append(new PrintFileToPrinter(), new PageFormat());
/**
* Set the object to be printed (the Book) into the PrinterJob. Doing this
* before bringing up the print dialog allows the print dialog to correctly
* display the page range to be printed and to dissallow any print settings
* not appropriate for the pages to be printed.