Hello everyone,
I’m close to finishing my app, but I’ve hit a roadblock that I’ve been stuck on for days. Here’s the basic logic I want to implement:
On the “Print Barcode” page, I generate a barcode with a random, unassigned number and print it using a thermal printer (a visual barcode).
Later, when I go to the order detail page, I use the “Assign Barcode” scanner section at the top to scan that unassigned barcode, and then assign it to the specific order by saving the barcode number in the assignedBarcode
field.
Up to this point, everything works fine.
The problem arises in the final step:
On the same order detail page, when I tap “Print Ticket,” the app fetches the order from Firebase, retrieves the assignedBarcode
value, and should convert that into a barcode image to display it as part of the printed ticket.
This works perfectly in the iOS simulator, on Android physical devices, and even in other environments. But when I try it on a real iPhone, the barcode prints distorted from the thermal printer.
Gemini suggests that this is because real iPhones have much higher screen resolutions, and the barcode image ends up with pixel dimensions that the printer can’t handle properly — hence the distorted output.
I’ve tried everything to solve this, but no luck so far.
This process shouldn’t be so complicated, but I feel like I’ve made it messier somehow.
If anyone can help me out with this, I would truly appreciate it.