Print Screen

Is there a way for me to have a print button on the screen through out the project that will allow me to press and it will print the entire screen at which i am looking at?

To print the current window that is open, put this in a button action performed script.

obj = system.gui.getParentWindow(event)
printJob = system.print.createPrintJob(obj) 
printJob.showPrintDialog = 0
printJob.orientation = system.print.LANDSCAPE
printJob.print()

To print everything currently visible on teh screen, for example, the main screen plus docked menus, popups, etc, use this code.

obj = system.gui.getParentWindow(event).parent
printJob = system.print.createPrintJob(obj) 
printJob.showPrintDialog = 0
printJob.orientation = system.print.LANDSCAPE
printJob.print()

Digging up another oldie! I can print a window from a button no problem…I want to print the current window from a client menu…I assume event does not apply because it is a menu…have tried to reference the window by common means and create the print job but nothing is working.

Have tried several different iterations of this…

obj = system.gui.getParentWindow(event)
#obj = system.gui.getWindow('ShedMap') 
  

printJob = system.print.createPrintJob(obj)
printJob = showPrintDialog = 0
printJob.orientation = system.print.LANDSCAPE
printJob.print()

Anybody printing from a menu?

Thanks