Epson Receipt Printer

Hi all,

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

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?

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?

I am printing using the following, as shown on Xojo’s website:

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.

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

Current version of Xojo and MacOS Mojave (10.14.6).

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

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. :wink:

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

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?)

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]

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

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

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

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