UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Connecting and printing from fiscal printer

Forums > Swift

@Cryv  

Hello guys, I'm new here and I've been following Paul's tutorials. I already managed to create a software for my shop to keep track of orders. Now I would like to interface with the fiscal printer and be able to print receipts. I looked over the internet and didn't found much to start from.

The printer is an RCH Printf and is connected via ethernet. Does anyone know where can i start?

Thank you in advance.

2      

Hi, without a bit more context it is hard to offer pointers.

Do you have macOS app? iOS app? If you have a macOS app then you could use system dialog possibly to print?

I am not at all familiar with this type of printer so I have no idea if it works natively or if you need some kind of special software.

https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Printing/osxp_aboutprinting/osxp_aboutprt.html

2      

@Cryv  

Hi thank you for your time, the app is a macOS app, the printer is connected via Ethernet cable, and i think i have to send the printer some specific command, to understand better, this is the protocol structure, as shown in the pdf i downloaded from the manufacturer:

  • <STX> <ADDS> <LUNGH> <PROT-ID> <DATI> <PACK-ID> <CHK> <ETX>

  • <STX>

  • <ADDS>

  • <LUNGH>

  • <PROT-ID> - <DATI>

  • <PACK-ID> - <CHK>

  • <ETX> = 02h -> start packet = xx -> address = yyy -> data length = z -> primary protocol identifier = p -> packets identifier = ww -> message checksum = 03h -> end packet

2      

Hi @Cryv

For iOS I think it to with "Share" framework. Because if you look a the native app (eg Photos) when you tap the share button you can print so look at the reciept and look at sharing then should get the print option (as well as email etc) maybe the person want e copy!

For macOS

Maybe have the reciept to PDF file then should be able to print from there

Nigel

2      

@Cryv  

Thank you Nigel for your answer, but that doesn't work, cause it's not a standard printer, it's a fiscal printer so it means that the printer itself needs to receive the command cause it registers every receipt and then sends it to the "goverment" automatically. So instead of just printing i need to tell the printer "ok i have a receipt for 5€ create a printint receipt", then it prints it and stores it in memory

Sorry english is not my main language, I hope it is clear

2      

Hacking with Swift is sponsored by RevenueCat

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.