I have a requirement where i need to call the printer API directly via my Java code and print. I have some specific alignment for my data. My code is as follows..
When i run this class in Eclipse , it works fine. But when i run this application in Unix environment , it is not printing the data. Instead it prints some characters like some ip adresses and some font names. Have analysed and found it to because of the format with which the data gets printed. It prints in a RAW format. I need to print my data alike. Please help me. Either i need to change this format to TEXT or use CUPS to configure. Please guide me how can i set the dataType to TEXT in Java so that it will print the data correctly.
"Learning is a Culture where your Eagerness & Curiosity plays a major Role".
karthik Suryanarayanan wrote:
When i run this class in Eclipse , it works fine. But when i run this application in Unix environment , it is not printing the data.
You have to give us more detail than that. Is it going to the same printer? Is it on the same machine? If not, using the same operating system?
If the only difference is it works from eclipse and not from the command line, then you just have to ensure that the command line is using the same jar and class files (and libraries) as the eclipse environment.
There is no issue from calling JAVA AWT API to printer in windows machine.
Printer is connected to Unix server and we are able print the files properly using the lpr filename command in unix server but in Unix server when we call to printer from java AWT API from application it is printing the junk characters and some setting relating informations are being printed on the papers.