How to get full screen on System.print.printToImage?


I would like to make screen capture button which capture hole screen including navigation bars to image file.
I can make this with system.print.printToImage function but it needs container name and I want to include all containers from all windows?
Maybe there is better way to do this?

Tommi Vahtera

The following code prints anything displayed in Ignition. It essentially grabs the frame that holds everything, and prints it.

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

Thanks, works nice !

Thanks Kyle,

I’ll have to bookmark this.

super, this is just what I was looking for too :smiley:

Does this still work for Ignition 8.0?

I get errors on line three saying " showprintdialog" does not exist…

Looks like it has changed to “.setShowPrintDialog(Boolean)”
Orientation also changed, “.setOrientation(int)”

obj = system.gui.getParentWindow(event) .parent
printJob = system.print.createPrintJob(obj) 

@PLCINC_NY, I just tested the original script, it still works perfectly fine. What are you getting for an error?

@bkthomas, nothing has changed. setShowPrintDialog(val) and showPrintDialog = val are the same thing.

The “setShowPrint(val)” & "setOrientation(0)

all worked well .

printJob.showPrint = val and printJob.orientation = val will also work.

1 Like

2 posts were split to a new topic: System.print in Perspective