# Epson Receipt Printer

**URL:** <https://forum.xojo.com/t/epson-receipt-printer/50484>\
**Category:** General\
**Created:** [October 4, 2019, 11:43pm UTC](https://forum.xojo.com/t/epson-receipt-printer/50484 "2019-10-04T23:43:14Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Byron\_Minick](https://forum.xojo.com/user_avatar/forum.xojo.com/byron_minick/32/869_2.png) [@Byron\_Minick](https://forum.xojo.com/u/Byron_Minick)\
**Post date:** [October 4, 2019, 11:43pm UTC](https://forum.xojo.com/t/epson-receipt-printer/50484/1 "2019-10-04T23:43:14Z")

</div>

Hi all,

I have been having fun learning how to print receipts with an Epson receipt printer. Pretty neat stuff… 🙂

However, I ran into a situation that I haven’t been able to solve yet. I would like to print two receipts (one immediately after the other). When I go to print the second receipt, Xojo instantly crashes for some reason. I was given some cryptic message: “Framework failed assertion at RBNSApplication.mm:389” Uh oh… Yeah. So, I thought to myself, “Why not just try out the nextPage() feature and maybe that allow me to print the next receipt?” Nope, that didn’t do it either.

Any ideas or thoughts or how to either print a second receipt, … or maybe trigger the receipt cutter feature?

---

<div class="post-metadata">

**Author:** ![anon20074439](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@anon20074439](https://forum.xojo.com/u/anon20074439)\
**Post date:** [October 5, 2019, 12:17am UTC](https://forum.xojo.com/t/epson-receipt-printer/50484/2 "2019-10-05T00:17:54Z")

</div>

How are you printing at the moment, just doing a print as you would do to a regular piece of paper in a regular printer, using the epson sdk or sending raw data to the printer?

---

<div class="post-metadata">

**Author:** ![Byron\_Minick](https://forum.xojo.com/user_avatar/forum.xojo.com/byron_minick/32/869_2.png) [@Byron\_Minick](https://forum.xojo.com/u/Byron_Minick)\
**Post date:** [October 5, 2019, 12:24am UTC](https://forum.xojo.com/t/epson-receipt-printer/50484/3 "2019-10-05T00:24:34Z")

</div>

I am printing using the following, as shown on Xojo’s [website](https://documentation.xojo.com/api/printing/print.htmlerSetup):

```auto
Dim g As Graphics
Dim p As PrinterSetup
p = New PrinterSetup
If p.PageSetupDialog Then
  g = OpenPrinterDialog(p)
  If g <> Nil Then
    g.DrawString("Hello World", 50, 50)
  End If
End If
```

It prints the first receipt without any issue, but when I try to repeat the process again, Xojo crashes with a message about a Framework error.

---

<div class="post-metadata">

**Author:** ![anon20074439](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@anon20074439](https://forum.xojo.com/u/anon20074439)\
**Post date:** [October 5, 2019, 12:27am UTC](https://forum.xojo.com/t/epson-receipt-printer/50484/4 "2019-10-05T00:27:17Z")

</div>

What version of Xojo are you using and what version is your OS?

---

<div class="post-metadata">

**Author:** ![Byron\_Minick](https://forum.xojo.com/user_avatar/forum.xojo.com/byron_minick/32/869_2.png) [@Byron\_Minick](https://forum.xojo.com/u/Byron_Minick)\
**Post date:** [October 5, 2019, 12:28am UTC](https://forum.xojo.com/t/epson-receipt-printer/50484/5 "2019-10-05T00:28:54Z")

</div>

Current version of Xojo and MacOS Mojave (10.14.6).

---

<div class="post-metadata">

**Author:** ![anon20074439](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@anon20074439](https://forum.xojo.com/u/anon20074439)\
**Post date:** [October 5, 2019, 12:30am UTC](https://forum.xojo.com/t/epson-receipt-printer/50484/6 "2019-10-05T00:30:17Z")

</div>

Thy this code a mo?

`Dim g As Graphics
Dim p As PrinterSetup
p = New PrinterSetup
If p.PageSetupDialog Then
  g = OpenPrinterDialog(p)
  If g <> Nil Then
    g.DrawString("Hello World", 50, 50)
    g.nextPage
    g.DrawString("Hello World Page2", 50, 50)
  End If
End If
`

---

<div class="post-metadata">

**Author:** ![Byron\_Minick](https://forum.xojo.com/user_avatar/forum.xojo.com/byron_minick/32/869_2.png) [@Byron\_Minick](https://forum.xojo.com/u/Byron_Minick)\
**Post date:** [October 5, 2019, 12:34am UTC](https://forum.xojo.com/t/epson-receipt-printer/50484/7 "2019-10-05T00:34:24Z")

</div>

I tried it and I get a blank line where the nextPage() method is, which is one of the things that puzzled me. I tried that code with a regular printer, and it works (but unfortunately, not for the Epson receipt printer)… Hmm. 😉

---

<div class="post-metadata">

**Author:** ![anon20074439](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@anon20074439](https://forum.xojo.com/u/anon20074439)\
**Post date:** [October 5, 2019, 12:37am UTC](https://forum.xojo.com/t/epson-receipt-printer/50484/8 "2019-10-05T00:37:24Z")

</div>

Does the printer cut the paper after the job is complete or is it not cutting at all?

---

<div class="post-metadata">

**Author:** ![Byron\_Minick](https://forum.xojo.com/user_avatar/forum.xojo.com/byron_minick/32/869_2.png) [@Byron\_Minick](https://forum.xojo.com/u/Byron_Minick)\
**Post date:** [October 5, 2019, 12:40am UTC](https://forum.xojo.com/t/epson-receipt-printer/50484/9 "2019-10-05T00:40:44Z")

</div>

Yes, it auto cuts the paper after the print job finishes. This is why I was attempting to print a second time after the first finished. (Maybe I need to put a “delay” in between print sessions?)

---

<div class="post-metadata">

**Author:** ![anon20074439](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@anon20074439](https://forum.xojo.com/u/anon20074439)\
**Post date:** [October 5, 2019, 12:48am UTC](https://forum.xojo.com/t/epson-receipt-printer/50484/10 "2019-10-05T00:48:07Z")

</div>

Try this:

[code]Dim p As PrinterSetup  
p = New PrinterSetup  
If p.PageSetupDialog Then

If True Then 'used to limit the scope of g, as soon as g goes out of scope it will cause the print to happen  
Dim g As Graphics  
g = OpenPrinterDialog§  
If g \<\> Nil Then  
g.DrawString(“Hello World 1”, 50, 50)  
End If  
End If

If True Then  
Dim g As Graphics  
g = OpenPrinter§  
If g \<\> Nil Then  
g.DrawString(“Hello World 2”, 50, 50)  
End If  
End If

End If  
[/code]

---

<div class="post-metadata">

**Author:** ![Byron\_Minick](https://forum.xojo.com/user_avatar/forum.xojo.com/byron_minick/32/869_2.png) [@Byron\_Minick](https://forum.xojo.com/u/Byron_Minick)\
**Post date:** [October 5, 2019, 12:58am UTC](https://forum.xojo.com/t/epson-receipt-printer/50484/11 "2019-10-05T00:58:53Z")

</div>

Wow, that is amazing – and yes, it works!! Thank you so much… I really appreciate it!! 🙂

---

<div class="post-metadata">

**Author:** ![anon20074439](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@anon20074439](https://forum.xojo.com/u/anon20074439)\
**Post date:** [October 5, 2019, 1:10am UTC](https://forum.xojo.com/t/epson-receipt-printer/50484/12 "2019-10-05T01:10:51Z")

</div>

No worries, could you do me a favour and PM me the code that caused the crash and I’ll add it as a bug into feedback for xojo to look into. Just click my name then click “Start a private conversation with …” on the next page

---

<div class="post-metadata">

**Author:** ![Ivan\_Tellez](https://forum.xojo.com/letter_avatar_proxy/v4/letter/i/a9a28c/32.png) [@Ivan\_Tellez](https://forum.xojo.com/u/Ivan_Tellez)\
**Post date:** [October 5, 2019, 1:31am UTC](https://forum.xojo.com/t/epson-receipt-printer/50484/13 "2019-10-05T01:31:02Z")

</div>

> [@456511:@Byron Minick](#):
>
> Any ideas or thoughts or how to either print a second receipt, … or maybe trigger the receipt cutter feature?

For Receipts, It is easier and more convenient to send jus one print job and set the number of copies in the printer settigs.

---

<div class="post-metadata">

**Author:** ![anon20074439](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@anon20074439](https://forum.xojo.com/u/anon20074439)\
**Post date:** [October 5, 2019, 1:48am UTC](https://forum.xojo.com/t/epson-receipt-printer/50484/14 "2019-10-05T01:48:20Z")

</div>

Sure, unless you need two different prints, like a receipt followed by a coupon.

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [April 29, 2021, 4:06pm UTC](https://forum.xojo.com/t/epson-receipt-printer/50484/15 "2021-04-29T16:06:47Z")

</div>


