Provides a general printing facility for printing the contents of a window or component to a printer. The general workflow for this function is that you create the print job, set the options you'd like on it, and then call print() on the job. For printing reports or tables, use those components' dedicated print() functions.
The PrintJob object that this function returns has the following properties that can be set:
If true (1), then the print dialog window will be shown before printing. This allows users to specify printing options like orientation, printer, paper size, margins, etc. [default: 1]
If the component is too wide or tall to fit on a page, it will be proportionately zoomed out until it fits into the page. [default: 1]
If greater than zero, this zoom factor will be used to zoom the printed image in or out. For example, if this is 0.5, the printed image will be half size. If used, this zoom factor overrides the fitToPage parameter. [default: -1.0]
Either system.print.PORTRAIT or system.print.LANDSCAPE
The width of the paper in inches. [default: 8.5]
The height of the paper in inches. [default: 11]
The margins, specified in inches. [default: 0.75]
You can set all of the margins at once with job.setMargins(number), and you initiate the printing with job.print().