# Printing From Perspective

**URL:** <https://forum.inductiveautomation.com/t/printing-from-perspective/103810>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [March 17, 2025, 9:13pm UTC](https://forum.inductiveautomation.com/t/printing-from-perspective/103810 "2025-03-17T21:13:25Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![scadafan](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@scadafan](https://forum.inductiveautomation.com/u/scadafan)\
**Post date:** [March 17, 2025, 9:13pm UTC](https://forum.inductiveautomation.com/t/printing-from-perspective/103810/1 "2025-03-17T21:13:25Z")

</div>

Hi there,

I am wondering what is the correct way to print a report using a button in perspective I thought it was this but that doesn't seem to do anything or throw me any errors:

```python
	system.report.executeAndDistribute(
	    path="LotPackagingLabel",
	    project="MES_App",
	    action="print",
	    actionSettings={"primaryPrinterName": "Canon TS3100 series"}
	)

```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 17, 2025, 9:24pm UTC](https://forum.inductiveautomation.com/t/printing-from-perspective/103810/2 "2025-03-17T21:24:43Z")

</div>

Does the Ignition service running in the gateway have that printer name defined? (Distinct from printers associated with a user logged into that server's desktop.)

---

<div class="post-metadata">

**Author:** ![scadafan](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@scadafan](https://forum.inductiveautomation.com/u/scadafan)\
**Post date:** [March 17, 2025, 9:26pm UTC](https://forum.inductiveautomation.com/t/printing-from-perspective/103810/3 "2025-03-17T21:26:24Z")

</div>

no this printer is just locally on my computer. Does it need to be on the actual gateway to print?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 17, 2025, 9:59pm UTC](https://forum.inductiveautomation.com/t/printing-from-perspective/103810/4 "2025-03-17T21:59:44Z")

</div>

From `.executeAndDistribute()`, yes. A Report Viewer or PDF Viewer under the browser users' control is needed to print locally.

Vision can script control of a local printer.

---

<div class="post-metadata">

**Author:** ![scadafan](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@scadafan](https://forum.inductiveautomation.com/u/scadafan)\
**Post date:** [March 17, 2025, 10:16pm UTC](https://forum.inductiveautomation.com/t/printing-from-perspective/103810/5 "2025-03-17T22:16:42Z")

</div>

Oh I see but to do a local test before running it directly to a network printer on the server I would need to use the report viewer?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 17, 2025, 10:19pm UTC](https://forum.inductiveautomation.com/t/printing-from-perspective/103810/6 "2025-03-17T22:19:55Z")

</div>

A report viewer, or a PDF viewer in the browser, can print to local printers at the browser location. The gateway, whether scripted `.reportAndDistribute()`, or any other automated printing from gateway scope, can only use the printers pre-configured for the user the gateway runs as.

---

<div class="post-metadata">

**Author:** ![scadafan](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@scadafan](https://forum.inductiveautomation.com/u/scadafan)\
**Post date:** [April 23, 2025, 7:38pm UTC](https://forum.inductiveautomation.com/t/printing-from-perspective/103810/7 "2025-04-23T19:38:56Z")

</div>

Sorry to revive this but how do you determine if the printer name is defined in Ignition

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 23, 2025, 7:47pm UTC](https://forum.inductiveautomation.com/t/printing-from-perspective/103810/8 "2025-04-23T19:47:07Z")

</div>

Probably this:  
[PrinterJob.lookupPrintServices()](https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/print/PrinterJob.html#lookupPrintServices())

Each item in the result will have a `.name` attribute.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [April 23, 2025, 8:18pm UTC](https://forum.inductiveautomation.com/t/printing-from-perspective/103810/9 "2025-04-23T20:18:18Z")

</div>

[`system.print.getPrinterNames()`](https://docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-print/system-print-getPrinterNames) works in all scopes for precisely this reason.

---

<div class="post-metadata">

**Author:** ![scadafan](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@scadafan](https://forum.inductiveautomation.com/u/scadafan)\
**Post date:** [April 23, 2025, 8:37pm UTC](https://forum.inductiveautomation.com/t/printing-from-perspective/103810/10 "2025-04-23T20:37:54Z")

</div>

Ok I see the name there and it matches what I have but still not getting anything. No errors in the logs either. I press the button and nothing happens. I have also tried a test print without using Ignition and it works so I know the printer is working:

```python
	system.report.executeAndDistribute(
	    path="LotPackagingLabel",
	    project="MES_App",
	    action="print",
	    actionSettings={"primaryPrinterName": "ZDesigner ZT510-203dpi ZPL"}
	)

```

This is happening on a button press

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 23, 2025, 9:07pm UTC](https://forum.inductiveautomation.com/t/printing-from-perspective/103810/11 "2025-04-23T21:07:15Z")

</div>

> [@scadafan](#):
>
> tried a test print without using Ignition

Why would you think that is a valid test? If you get no names in gateway scope, then the gateway user account has no printers defined.

(Testing in the designer script console tests the printers for the desktop user logged in, not printers for any other user account.)

---

<div class="post-metadata">

**Author:** ![scadafan](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@scadafan](https://forum.inductiveautomation.com/u/scadafan)\
**Post date:** [April 23, 2025, 9:25pm UTC](https://forum.inductiveautomation.com/t/printing-from-perspective/103810/12 "2025-04-23T21:25:25Z")

</div>

I tried the test print to rule out if the printer drivers might have been messed up. If testing in the script console is not the way either where should I try and make sure this printer is accessible by Ignition service?

Ran the system.print.getPrinterNames() this was the result:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/3/13586c7940d00fc88ba15317415437ced732ef6b.png)

Which shows the printer in there. This is directly on the Ignition gateway

---

<div class="post-metadata">

**Author:** ![scadafan](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@scadafan](https://forum.inductiveautomation.com/u/scadafan)\
**Post date:** [April 24, 2025, 3:00pm UTC](https://forum.inductiveautomation.com/t/printing-from-perspective/103810/13 "2025-04-24T15:00:38Z")

</div>

Took another look forgot to mention that my Ignition is running off a service. Would that explain why the print command isn't making it to the printer?
