# Using system.print in place of 3rd party software, printing from gateway?

**URL:** <https://forum.inductiveautomation.com/t/using-system-print-in-place-of-3rd-party-software-printing-from-gateway/38094>\
**Category:** Ignition\
**Tags:** ignition79, ignition80\
**Created:** [August 26, 2020, 1:42pm UTC](https://forum.inductiveautomation.com/t/using-system-print-in-place-of-3rd-party-software-printing-from-gateway/38094 "2020-08-26T13:42:39Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [August 26, 2020, 1:42pm UTC](https://forum.inductiveautomation.com/t/using-system-print-in-place-of-3rd-party-software-printing-from-gateway/38094/1 "2020-08-26T13:42:39Z")

</div>

General question here. I recently took over a few systems that utilize 3rd party barcode printing software like BarTender or CoLOS to handle printing barcodes. I recently learned of the system.print functionality and was interested in seeing if anyone uses this to print barcodes on an industrial scale/rate? I enjoy being able to design the barcode in Ignition instead of undocumented and clunky 3rd party software, also I would enjoy being able to see a stack trace as it would remove one layer of complexity and a layer of software where stuff can go wrong (which recently happened to me and I’ve been working with tech support via email for over a week now, whereas Ignition has great support). Not to mention it would seem like it would be much easier to know when to trigger the print instead of 3rd party integration software just constantly polling my database or looking for a file change.

Does anyone the system.print functionality to print say product or case barcodes? And is it 100% necessary to actually create a window? Or, as I suspect, can I just run a gateway script, use `system.nav.openWindow` with appropriate parameters and be able to print using a reference to that window without it ever opening on a client?

---

<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:** [August 26, 2020, 1:44pm UTC](https://forum.inductiveautomation.com/t/using-system-print-in-place-of-3rd-party-software-printing-from-gateway/38094/2 "2020-08-26T13:44:55Z")

</div>

Those functions don’t work in the gateway. There’s no Swing GUI.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [August 26, 2020, 1:45pm UTC](https://forum.inductiveautomation.com/t/using-system-print-in-place-of-3rd-party-software-printing-from-gateway/38094/3 "2020-08-26T13:45:19Z")

</div>

There goes my dream. Ok good to know.

---

<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:** [August 26, 2020, 2:26pm UTC](https://forum.inductiveautomation.com/t/using-system-print-in-place-of-3rd-party-software-printing-from-gateway/38094/4 "2020-08-26T14:26:56Z")

</div>

Well, you could also use the reporting module. Plenty of customers do just what you’re describing - design labels and print them via reporting.

---

<div class="post-metadata">

**Author:** ![yifeiliu08](https://avatars.discourse-cdn.com/v4/letter/y/bbe5ce/32.png) [@yifeiliu08](https://forum.inductiveautomation.com/u/yifeiliu08)\
**Post date:** [August 28, 2020, 2:36pm UTC](https://forum.inductiveautomation.com/t/using-system-print-in-place-of-3rd-party-software-printing-from-gateway/38094/5 "2020-08-28T14:36:04Z")

</div>

i have try to use the ignition's system.print function in my factory's process to create barcode

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/9/19cf45683e70d15b9c7ee57e0cbb44ced6d9b620.png)  
i use a template to create a image in the mainwindows  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/6/36b1e6631a798e30280da71ab3f2ff793413bd75.png)  
then i write a scripting in the client event, if 1 cycle complete , the opc tag will trigger the print function , it will automatically print a label

> [@system.print.createPrintJob auto print](http://forum.inductiveautomation.com/t/system-print-createprintjob-auto-print/32791):
>
> [image] Script job =system.print.createPrintJob(event.source.parent.getComponent(‘PrintLabel’)) job.setPrinterName(‘Argox CP-3140L PPLB’) job.print() but if i create a automatically print without notification it will appear many page i don’t know how to do this scripting if no reminder , that can print only 1 page.

i can share you what i learn from this forum

---

<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:** [August 28, 2020, 2:56pm UTC](https://forum.inductiveautomation.com/t/using-system-print-in-place-of-3rd-party-software-printing-from-gateway/38094/6 "2020-08-28T14:56:29Z")

</div>

`system.print.createPrintJob` can only ever work in a Vision client, not in the gateway. The OP wants to generate and print fully automatically from the gateway. Paul’s suggestion is the definitive solution.

---

<div class="post-metadata">

**Author:** ![Francisco\_Ochoa](https://avatars.discourse-cdn.com/v4/letter/f/e495f1/32.png) [@Francisco\_Ochoa](https://forum.inductiveautomation.com/u/Francisco_Ochoa)\
**Post date:** [September 30, 2024, 3:34pm UTC](https://forum.inductiveautomation.com/t/using-system-print-in-place-of-3rd-party-software-printing-from-gateway/38094/7 "2024-09-30T15:34:55Z")

</div>

i have this error , can you help me please??

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/7/c7e35b3710fcc7c8d5828dfa48733c96625c2464.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/a/ead83a7de122ccf7292c9303af3b8954a165a5cd.png)

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [September 30, 2024, 4:08pm UTC](https://forum.inductiveautomation.com/t/using-system-print-in-place-of-3rd-party-software-printing-from-gateway/38094/8 "2024-09-30T16:08:38Z")

</div>

In your script you use `MDMNP021` as the name but it appears the name is `MDMNP021 on mdmps001` on the computer. The error hints to this as well.

Also never use time.sleep, and here there is zero reason for it as well.

You can use this to verify

> **[system.print.getPrinterNames | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-print/system-print-getPrinterNames)**
>
> Lists the available local printers.

---

<div class="post-metadata">

**Author:** ![Francisco\_Ochoa](https://avatars.discourse-cdn.com/v4/letter/f/e495f1/32.png) [@Francisco\_Ochoa](https://forum.inductiveautomation.com/u/Francisco_Ochoa)\
**Post date:** [September 30, 2024, 5:19pm UTC](https://forum.inductiveautomation.com/t/using-system-print-in-place-of-3rd-party-software-printing-from-gateway/38094/9 "2024-09-30T17:19:31Z")

</div>

when i use system.print.getPrinterNames() this appear

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/b/9b72cc81426c9f08dd627993fce210bc8b1027a7.png)

---

<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:** [September 30, 2024, 5:26pm UTC](https://forum.inductiveautomation.com/t/using-system-print-in-place-of-3rd-party-software-printing-from-gateway/38094/10 "2024-09-30T17:26:04Z")

</div>

So...use the name that it shows there in your call to the print functions?

`\\mdmps001` is presumably the network location the printer is being provided by.

---

<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:** [September 30, 2024, 5:54pm UTC](https://forum.inductiveautomation.com/t/using-system-print-in-place-of-3rd-party-software-printing-from-gateway/38094/11 "2024-09-30T17:54:08Z")

</div>

You are running that in the script console. Which will give you the names that the designer JVM knows. That isn't the list that the gateway service will know about.

---

<div class="post-metadata">

**Author:** ![Francisco\_Ochoa](https://avatars.discourse-cdn.com/v4/letter/f/e495f1/32.png) [@Francisco\_Ochoa](https://forum.inductiveautomation.com/u/Francisco_Ochoa)\
**Post date:** [September 30, 2024, 5:55pm UTC](https://forum.inductiveautomation.com/t/using-system-print-in-place-of-3rd-party-software-printing-from-gateway/38094/12 "2024-09-30T17:55:46Z")

</div>

when i put the script in the Client Event nothing happen

---

<div class="post-metadata">

**Author:** ![Francisco\_Ochoa](https://avatars.discourse-cdn.com/v4/letter/f/e495f1/32.png) [@Francisco\_Ochoa](https://forum.inductiveautomation.com/u/Francisco_Ochoa)\
**Post date:** [October 15, 2024, 12:27am UTC](https://forum.inductiveautomation.com/t/using-system-print-in-place-of-3rd-party-software-printing-from-gateway/38094/14 "2024-10-15T00:27:52Z")

</div>

i can did it , but i need to have the Window open , if possible to send print without the window opened?

```python
value=system.tag.read('[default]test').value
Page=system.gui.getWindow("Barcode Generator")
job=system.print.createPrintJob(Page.rootContainer)
if(value==1):
	system.print.getDefaultPrinterName()
	job.setShowPrintDialog(0)
	job.setPageHeight(2)
	job.setPageWidth(1.3)
	job.setBottomMargin(0.01)
	job.setTopMargin(0.01)
	job.setRightMargin(0.01)
	job.setLeftMargin(0.01)
	job.setFitToPage(1)
	job.print()

```

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/8/c81ca72fd35569ac93441a76880054f118eeba45.png)

---

<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:** [October 15, 2024, 12:38am UTC](https://forum.inductiveautomation.com/t/using-system-print-in-place-of-3rd-party-software-printing-from-gateway/38094/15 "2024-10-15T00:38:04Z")

</div>

> [@Francisco\_Ochoa](#):
>
> if possible to send print without the window opened?

No.
