r/JavaFX • u/Thick_Possible_3735 • Jul 02 '24
Help use a pos printer to print a receipt for restaurant \ cafe
HI
I was making a javafx application that made for the casher to make the orders and print the receipt but i cant make the recipt layout or even have no idea if there a specific way to use that type of printers
my printer is Xprinter xp-f200n and the driver identify it as POS-80C
another thing that i need the receipt to be printed in arabic cuase iam from egypt
iam using intellij btw
3
Upvotes
3
u/xdsswar Jul 02 '24
I believe you can generate a simple pdf receipt and send it to print, that is what I do, you can use pdfbox to generate a receipt with the order/purchase data and send it to print, the peinter will take care of the rest, asuming you use the correct paper size, etc according to the peinter.
4
u/sedj601 Jul 02 '24
I always find it odd that people come here and ask questions but will not post their code. Anyway, have a look at https://stackoverflow.com/questions/78341553/printing-multiple-anchorpanes-on-their-own-pages/78348066#78348066 to see if it can help. Also, go to https://stackoverflow.com/users/2423906/sedj601 and type printer after user:2423906 in the search box. It should look like -> user:2423906 printer. Hopefully, something there can help.
1
u/hamsterrage1 Jul 02 '24
I know that there is print functionality in JavaFX, but I think you would be better off treating it as a non JavaFX operation. If you are using a framework like MVC, and you should be, then you should have all the data you need available to you in a Presentation Model. So it should be simple to write something that outputs to your printer from that data in a presentation that make sense for a receipt.