Print full size windows

window = system.gui.getParentWindow(event) #rc = window.rootContainer.getComponent("Container") rc = window.rootContainer job = system.print.createPrintJob(rc) job.setMargins(0.5) job.showPageFormat = 1 job.orientation = 0 job.print()
Version 7.6.3
This is the event on a print button which is located inside a template on my window.
The template path is a client tag.
I am using this button in all my templates to print the template inside the window and the template is the same size of the window.
I am printing different sized images depending on which printer I’m using and I would like to stretch the image to print on the entire page if possible.

Another issue I am having is that over VPN, I can only print 2 templates. One of them has few tags and the other template path is the client tag value on startup. Every other print attempt results in a null pointer exception error and the project flashing and repainting over and over again until I close it.

here is the error:
java.lang.ArrayIndexOutOfBoundsException: 0
at sun.font.ExtendedTextSourceLabel.createCharinfo(Unknown Source)
at sun.font.ExtendedTextSourceLabel.getCharinfo(Unknown Source)
at sun.font.ExtendedTextSourceLabel.getAdvanceBetween(Unknown Source)
at java.awt.font.TextLine.getAdvanceBetween(Unknown Source)
at java.awt.font.TextLine.getJustifiedLine(Unknown Source)
at java.awt.font.TextLayout.getJustifiedLayout(Unknown Source)
at sun.swing.SwingUtilities2.drawString(Unknown Source)
at sun.swing.SwingUtilities2.drawStringUnderlineCharAt(Unknown Source)
at javax.swing.plaf.basic.BasicLabelUI.paintEnabledText(Unknown Source)
at com.incors.plaf.alloy.AlloyLabelUI.paint(Unknown Source)
at com.incors.plaf.alloy.AlloyLabelUI.update(Unknown Source)
at javax.swing.JComponent.paintComponent(Unknown Source)
at com.inductiveautomation.factorypmi.application.components.PMILabel.paintComponent(PMILabel.java:143)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at com.inductiveautomation.vision.api.client.components.model.AbstractVisionPanel.paintChildren(AbstractVisionPanel.java:238)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at com.inductiveautomation.vision.api.client.components.model.AbstractVisionPanel.paintChildren(AbstractVisionPanel.java:238)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at com.inductiveautomation.vision.api.client.components.model.AbstractVisionPanel.paintChildren(AbstractVisionPanel.java:238)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at com.inductiveautomation.vision.api.client.components.model.AbstractVisionPanel.paintChildren(AbstractVisionPanel.java:238)
at javax.swing.JComponent.paint(Unknown Source)
at com.inductiveautomation.factorypmi.application.script.builtin.PrintUtilities$ComponentPrinter.print(PrintUtilities.java:293)
at sun.print.RasterPrinterJob.printPage(Unknown Source)
at sun.print.RasterPrinterJob.print(Unknown Source)
at com.inductiveautomation.factorypmi.application.print.FPMIPrinterJob.print(FPMIPrinterJob.java:453)
at com.inductiveautomation.factorypmi.application.script.builtin.PrintUtilities$JythonPrintJob.print(PrintUtilities.java:126)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.python.core.PyReflectedFunction.call(PyReflectedFunction.java:186)
at org.python.core.PyReflectedFunction.call(PyReflectedFunction.java:204)
at org.python.core.PyObject.call(PyObject.java:387)
at org.python.core.PyObject.call(PyObject.java:391)
at org.python.core.PyMethod.call(PyMethod.java:109)
at org.python.pycode._pyx22.f$0(event:actionPerformed:9)
at org.python.pycode._pyx22.call_function(event:actionPerformed)
at org.python.core.PyTableCode.call(PyTableCode.java:165)
at org.python.core.PyCode.call(PyCode.java:18)
at org.python.core.Py.runCode(Py.java:1275)
at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:552)
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.runActions(ActionAdapter.java:155)
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.invoke(ActionAdapter.java:266)
at com.inductiveautomation.factorypmi.application.binding.action.RelayInvocationHandler.invoke(RelayInvocationHandler.java:55)
at com.sun.proxy.$Proxy15.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$400(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Ignition v7.6.3 (b2013090513)
Java: Sun Microsystems Inc. 1.6.0_45

If you are having problems with zoom, there are a few settings for the system.print.createPrintJob() function. You can see all the options in the user manual.

You say you are having problems printing a 3rd time through VPN, but are you using a script that prints multiple times, or is it a button that works the first two times it’s pressed then stops after that?