# Printing badge size labels

**URL:** <https://forum.inductiveautomation.com/t/printing-badge-size-labels/16207>\
**Category:** Ignition\
**Created:** [December 4, 2017, 5:23pm UTC](https://forum.inductiveautomation.com/t/printing-badge-size-labels/16207 "2017-12-04T17:23:26Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mr.K001](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@Mr.K001](https://forum.inductiveautomation.com/u/Mr.K001)\
**Post date:** [December 4, 2017, 5:23pm UTC](https://forum.inductiveautomation.com/t/printing-badge-size-labels/16207/1 "2017-12-04T17:23:26Z")

</div>

Hey guys,  
I was wondering if anyone has done any small size printing. We have this visitor page that signs them in and prints their info on on 4x2(in) sticky badges. I've got the page working and all, where I'm struggling is to get the print to come out right, it keeps coming out smaller and on bottom left corner. I tried to mess around with all the print job properties and see if I can get it working but no luck.  
I've created a group called print that receives all the entered data and displays in on that label and I print that label.  
this is one of the test script codes I tried with no luck.

> job = system.print.createPrintJob(event.source.parent.getComponent('Print'))  
> job.setShowPrintDialog(0)  
> job.setPageHeight(3)  
> job.setPageWidth(5)  
> job.setMargins(0.5)  
> job.setOrientation(0)  
> job.setFitToPage(1)  
> job.print()

I appreciate and suggestions you guys have.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [December 4, 2017, 6:46pm UTC](https://forum.inductiveautomation.com/t/printing-badge-size-labels/16207/2 "2017-12-04T18:46:12Z")

</div>

What printer are you using? What OS?

---

<div class="post-metadata">

**Author:** ![Mr.K001](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@Mr.K001](https://forum.inductiveautomation.com/u/Mr.K001)\
**Post date:** [December 4, 2017, 6:48pm UTC](https://forum.inductiveautomation.com/t/printing-badge-size-labels/16207/3 "2017-12-04T18:48:48Z")

</div>

Windows 8.1 Pro and Printer is DYMO Label Writer 450 Turbo

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [December 4, 2017, 7:34pm UTC](https://forum.inductiveautomation.com/t/printing-badge-size-labels/16207/4 "2017-12-04T19:34:43Z")

</div>

There's another relevant thread here on it. Did you happen to see it?

> [@Hide the print dialog but print barcode](http://forum.inductiveautomation.com/t/hide-the-print-dialog-but-print-barcode/14332):
>
> Here is the code I have on a button to print a barcode. The problem is that when I uncomment the setshowprintdialog(0) line, the print dialog goes away BUT so does the barcode when it is printed. Using a DYMO LabelWriter 450 Turbo printer if that makes a difference. Ignition 7.9.2 try: #Print the Barcode to a Label job = system.print.createPrintJob(event.source.parent.getComponent('Barcode')) job.setOrientation(0) job.setPrinterName("DYMO LabelWriter 450 Turbo") job.setPageHeight(40) job.…

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [December 4, 2017, 7:38pm UTC](https://forum.inductiveautomation.com/t/printing-badge-size-labels/16207/5 "2017-12-04T19:38:04Z")

</div>

Sorry, posted before my thought was done. Darn age… heh.

I’d try getting rid of the page width, and set the height higher. the fit to page should shrink it okay, but doesn’t always do well expanding things out.

---

<div class="post-metadata">

**Author:** ![Mr.K001](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@Mr.K001](https://forum.inductiveautomation.com/u/Mr.K001)\
**Post date:** [December 4, 2017, 8:40pm UTC](https://forum.inductiveautomation.com/t/printing-badge-size-labels/16207/6 "2017-12-04T20:40:21Z")

</div>

ahh, I did search the forum but didn’t search it by printer name… rookie mistake on my part lol…  
I’ll look over that thread and try your suggestion and see what happens.

---

<div class="post-metadata">

**Author:** ![Mr.K001](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@Mr.K001](https://forum.inductiveautomation.com/u/Mr.K001)\
**Post date:** [December 5, 2017, 1:53pm UTC](https://forum.inductiveautomation.com/t/printing-badge-size-labels/16207/7 "2017-12-05T13:53:32Z")

</div>

So the printer dialog has a tab that has sizes, on default it’s set on some label CD, if I change it to “99014 Name Badge Label” the print comes out pretty darn close. I looked that up and its 89mm x 26mm I even tried to put those measurement in inches on set height and width but still no luck. Am I missing something else that size setting does beside the height and width? or is there a way to specifically select that size in scripting code?

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [December 6, 2017, 3:45pm UTC](https://forum.inductiveautomation.com/t/printing-badge-size-labels/16207/8 "2017-12-06T15:45:06Z")

</div>

Not sure how much more I can help you out on this one. I don’t have anything similar to play with (all my labelers are Zebra).

However, I did find a github entry that has a [Java implementation for Dymo](https://github.com/simsam7/dymolabelwriter/blob/master/src/sam/LabelWriter.java). That might give you some ideas to noodle around.

---

<div class="post-metadata">

**Author:** ![AJBerera](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@AJBerera](https://forum.inductiveautomation.com/u/AJBerera)\
**Post date:** [December 8, 2017, 1:05pm UTC](https://forum.inductiveautomation.com/t/printing-badge-size-labels/16207/9 "2017-12-08T13:05:56Z")

</div>

The size settings here in this code are in inches.  
I am not using the print dialog which is why I have setShowPrintDialog set to 0

```auto
#Print the Barcode to a Label
job = system.print.createPrintJob(event.source.parent.getComponent('Barcode'))
job.setPrinterName("DYMO LabelWriter 450 Turbo")
#job.setPrinterName("\\\wbysr002\\WBY TOSHIBA 2ND FLOOR")
job.setOrientation(0)

job.setMargins(0.05)
job.setPageHeight(3.5)
job.setPageWidth(1)
job.setFitToPage(1)
job.setShowPrintDialog(0)
job.print()

```

---

<div class="post-metadata">

**Author:** ![Mr.K001](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@Mr.K001](https://forum.inductiveautomation.com/u/Mr.K001)\
**Post date:** [December 8, 2017, 1:44pm UTC](https://forum.inductiveautomation.com/t/printing-badge-size-labels/16207/10 "2017-12-08T13:44:21Z")

</div>

Thanks, I will test this, one other question, did you set your barcode component size accordingly?

---

<div class="post-metadata">

**Author:** ![AJBerera](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@AJBerera](https://forum.inductiveautomation.com/u/AJBerera)\
**Post date:** [December 8, 2017, 1:46pm UTC](https://forum.inductiveautomation.com/t/printing-badge-size-labels/16207/11 "2017-12-08T13:46:51Z")

</div>

If the barcode is in a container and you print the container, it will be much easier.

---

<div class="post-metadata">

**Author:** ![Mr.K001](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@Mr.K001](https://forum.inductiveautomation.com/u/Mr.K001)\
**Post date:** [December 8, 2017, 1:48pm UTC](https://forum.inductiveautomation.com/t/printing-badge-size-labels/16207/12 "2017-12-08T13:48:25Z")

</div>

Yes my container is in the same page I’m triggering the print from. I just didn’t know how much the sizing of the component will make a difference.

---

<div class="post-metadata">

**Author:** ![AJBerera](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@AJBerera](https://forum.inductiveautomation.com/u/AJBerera)\
**Post date:** [September 27, 2018, 1:28pm UTC](https://forum.inductiveautomation.com/t/printing-badge-size-labels/16207/13 "2018-09-27T13:28:48Z")

</div>

I am trying to print on a 4" by 2.5" label now. I can’t seem to set my margins, even with the print dialog settings.

---

<div class="post-metadata">

**Author:** ![Mr.K001](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@Mr.K001](https://forum.inductiveautomation.com/u/Mr.K001)\
**Post date:** [September 28, 2018, 5:13pm UTC](https://forum.inductiveautomation.com/t/printing-badge-size-labels/16207/14 "2018-09-28T17:13:49Z")

</div>

what does it look like? your description is not clear. can you send a picture of how the label looks?
