You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by mukadobo <mu...@gmail.com> on 2011/01/23 21:12:36 UTC

How to print a Pivot window?

I'm a Pivot nubi (and a Java GUI nubi in general) - can someone please give
clear / simple help on how to print Pivot window?  

The simplest case is to print a given window's layout exactly as it appears
on the screen.  Likely complifications include:

* adding a header / footer that aren't part of the displayed window -
possibly with dynamic content, such as page # (e.g. as how web browsers add
the URL when printing the displayed page);
* cycling the window contents and printing each time (e.g. as in a set of
pages, perhaps once for each order of the current customer);
* optionally obscuring some of the visual components when printing (e.g.
SSN, credit card #, etc.) without otherwise changing the layout;
* window to printer-page scaling and multi-page-per-window handling (e.g.
when a very large Table might be broken into a grid of printer-pages,
possibly repeating headers, footers, left- or right-side columns);

NOTE: I would prefer a generic printer solution, but something that "merely"
generates a PDF stream would be acceptable.


TIA!
-- 
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/How-to-print-a-Pivot-window-tp2315436p2315436.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: How to print a Pivot window?

Posted by Greg Brown <gk...@verizon.net>.
> I'm a Pivot nubi (and a Java GUI nubi in general) - can someone please give
> clear / simple help on how to print Pivot window?  

I actually haven't done much Java-based printing myself, but you should be able to paint() a Pivot component to a Graphics2D object representing a printer. This is probably a good place to start:

http://download.oracle.com/javase/tutorial/2d/printing/index.html

I believe there are libraries available that will also let you generate PDFs using a similar approach.

G