final java.awt.print.PrinterJob job = java.awt.print.PrinterJob.getPrinterJob(); new Thread() { public void run() { com.cosylab.vdct.graphics.printing.Page.setPageFormat(job.pageDialog(com.cosylab.vdct.graphics.printing.Page.getPageFormat()));
final GetPrintableInterface pi = (GetPrintableInterface)CommandManager.getInstance().getCommand("GetPrintableInterface");  if(pi == null) return;  PrintRequestAttributeSet printRequestAttributeSet = Page.getPrintRequestAttributeSet();  PrinterJob printerJob = PrinterJob.getPrinterJob();  PageFormat pageFormat = printerJob.pageDialog(printRequestAttributeSet); if(pageFormat==null) return;  int pageFormatOrientation = PageFormat.PORTRAIT;  OrientationRequested orientationRequested = (OrientationRequested) printRequestAttributeSet.get(OrientationRequested.class);  if(orientationRequested != null) { if(orientationRequested.equals(OrientationRequested.LANDSCAPE)) pageFormatOrientation = PageFormat.LANDSCAPE; else if(orientationRequested.equals(OrientationRequested.REVERSE_LANDSCAPE)) pageFormatOrientation = PageFormat.REVERSE_LANDSCAPE;
public void pageSetupMenuItem_ActionPerformed(java.awt.event.ActionEvent actionEvent) {	final java.awt.print.PrinterJob job = java.awt.print.PrinterJob.getPrinterJob();		new Thread() {			public void run() {				com.cosylab.vdct.graphics.printing.Page.setPageFormat(job.pageDialog(com.cosylab.vdct.graphics.printing.Page.getPageFormat()));			}		}.start();}