Simply add the PrintPreview.jar file to your classpath and you have access to all of the classes and methods of the PrintPreview.
Copyright (C) 2014 --- Don Spickler
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details, http://www.gnu.org/licenses/.
The PrintPreview class is an extendible preview frame for either a Printable object or a Book object. The preview frame has a toolbar with options for changing the page orientation, invoking a page setup dialog to allow the user to set paper type and margins, printing the document, and a zoom bar for scaling the preview pages. Since the orientation and page setup options work globally on the document, if a Book is loaded into the preview, it will use the page format of the first page for the entire document.
The content pane of the frame is set to a Border layout using the North section for the toolbar, the South for the zoom slider control, and the Center for the page preview area. Extensions of this class can easily use the East and West sections for specialized option panels.
This example contains an Eclipse project of a very short example of how the PrintPreview API works. It is simply a text area with two option, one to open the basic print preview frame for the document and the other to open an extension of the print preview frame which contains some font size options. The JavaDoc for the API has a more detailed description of the methods available.