[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details

Java: Print in textmode through COM-port to Epson TM-T88III Thermal Printer

Asked by alexteg in Java Programming Language, Printers

Tags: java, print, textmode, COM-port, Epson TM-T88III Thermal Printer

I need to print text in textmode from Java to a Epson TM-T88III Thermal Printer (with paper roll for printing receipts). It's connected to the COM-port (serial 9-pin) and works like a normal printer, however it seems like that when printing from for example Notepad, it converts text to graphics and prints very slowly. So I need to use some of the built in fonts. It should also print without any confirmation from the user. However, when it finishes printing successfully it should report it or otherwise report the error. How can I do all this in java?

I tried doing it through FileOutputStream and PrintStream (see attached code), but it gave me access denied (using Windows XP SP3). I also need to make sure the printer cuts the paper (Feed & Cut). Printing with dialog is not an option. Maybe printing with the Java print API, but I haven't really understood how I can do it easily. Does anyone have a suggestion?
1:
2:
3:
4:
5:
6:
7:
8:
9:
try {
    FileOutputStream fos = new FileOutputStream("COM1");
    PrintStream ps = new PrintStream(fos);
    ps.print("Testing");
    ps.print("\f");
    ps.close();
}catch (Exception e) {
    System.out.println("Error: " + e);
}
 
Related Solutions
Keywords: Java: Print in textmode through COM…
 
Loading Advertisement...
 
[+][-]11/08/09 03:56 PM, ID: 25772630Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/08/09 04:34 PM, ID: 25772748Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/09/09 07:19 AM, ID: 25776607Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/10/09 08:51 AM, ID: 25787235Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/10/09 09:02 AM, ID: 25787365Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/10/09 09:43 AM, ID: 25787790Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/10/09 09:51 AM, ID: 25787857Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89 - Hierarchy / EE_QW_3_20080625