4

Sorry of this seems like a basic question but I am new to printing in Java.

I am writing a small POS application using Java. The application is almost finished except for the invoice printing part. The program will be distributed via the internet.

Is there any way for the program to be able to connect to a wide array of POS printers, or must I choose a specific printer and add its jpos.xml file to my project?

Since I wont be installing the program on the clients’ computers and configuring the hardware, I would like it to work with POS printers that the client already has on the system. Is that possible?

Arnaud Denoyelle
  • 29,980
  • 16
  • 92
  • 148
user3245747
  • 805
  • 2
  • 17
  • 30
  • 2
    In the past I was try the same thing, but I find out that is more easy to print on the POS, like a normal printer. And not write for every specific POS manufacturer. Sorry for my english. – KostasC Apr 27 '15 at 09:21
  • Can you please give me an example? How do you set the page size the height depends on the number of items in the document, and how do you open the cash drawer? Also, how do you make sure that the program chooses the correct printer in case there are several connected to the computer. – user3245747 Apr 27 '15 at 09:39
  • 1
    Take a look here: [link](https://docs.oracle.com/javase/tutorial/2d/printing/printable.html) and here [link](http://stackoverflow.com/questions/4177531/force-target-printer-in-java) – KostasC Apr 27 '15 at 10:03
  • You can also configure the jpos.xml path with an env-var and load it from there, then the user has to generate the jpos.xml file (this is how I did it). – thi gg Jun 15 '15 at 07:08

0 Answers0