The PrinterData object contains information about current printing job. : PrinterData « SWT « Java Tutorial






import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.printing.Printer;
import org.eclipse.swt.printing.PrinterData;

public class PrinterDataFromPrinter {
  public static void main(String[] args) {
    Printer printer = new Printer();
    
    PrinterData printerData = printer.getPrinterData();
    
    System.out.println(printerData.driver);
    
    if (printer.startJob("Printing . . .")) {
      GC gc = new GC(printer);
      if (printer.startPage()) {
        gc.drawText("Hello, World!", 20, 20);
        printer.endPage();
      }
      gc.dispose();
    }
    printer.dispose();
  }
}








17.112.PrinterData
17.112.1.The PrinterData object contains information about current printing job.