Printing Multiple Containers

Is it possible to print multiple containers at one time?

If so what would the syntax look like?

Such as:

job = system.print.createPrintJob(event.source.parent.getComponent(‘Container_Page1’)) and
system.print.createPrintJob(event.source.parent.getComponent(‘Container_Page2’)) and
system.print.createPrintJob(event.source.parent.getComponent(‘Container_Page3’)) and
system.print.createPrintJob(event.source.parent.getComponent(‘Container_Page4’))
job.setMargins(0.5)
job.zoomFactor = -1.0
job.orientation = system.print.LANDSCAPE
job.showPageFormat = 0
job.print()

You can print the root container which contains each sub container. The print function only takes a single component.

if I print the root container then i can’t read the other containers because they are too small. I have sized the containers to fit the paper size.

If there a way to print multiple pages of the root container?

Do you mean have one container spread out over multiple pages? If so, that can’t be done, as the system.print.createPrintJob() only handles putting components into one page. There is probably a way it can be done using Java’s API. For more information about using Java in Ignition:

inductiveautomation.com/support/ … g_java.htm

Root Container is 1280 x 3000, so it is too big to print on one page .

Another method would be sequentially printing several containers one after the other. That would be much simpler than messing about with the Java print API…

I am already doing this.

See previous post !

Can this be done without having to click the printer button 4 times?

If you are just sending things to the default printer, then you can turn off the dialog box with the showPrintDialog switch:

[code]job = system.print.createPrintJob(event.source.parent)
job.setMargins(0.5)
job.zoomFactor = 0.75
job.showPageFormat = 0

job.showPrintDialog = 0

job.print()[/code]

Perhaps if you had phrased the part about not wanting to hit the print button… :wink:

Of course, if there was a handy append method, that would be cool.