Results 1 to 1 of 1
- 09-21-2010, 10:48 AM #1
Member
- Join Date
- Dec 2009
- Posts
- 1
- Rep Power
- 0
WriteUTF() add junk characters to Bluetooth printer
Hi guys,
I am having problem sending printing to a portable bluetooth printer.
It always print out additional junk characters in front of the content.
Example:
KHello World
**It should be display "Hello World" only. A random characters will be display in front of the content, for
this case is the letter "K". I google and search many forums but found nothing that can help me solve this
problem. I know WriteUTF() will add 2 bytes in front to my string. FYI. I previously use WriteChars() to print
english words but now need to use WriteUTF to print the Chinese words. Is there anyway to fix this? Any help
will be appreciated.
My Coding:
============
String url = "btspp://00099BC9BC98:1;authenticate=false;encrypt=false;ma ster=false";
StreamConnection con = (StreamConnection) Connector.open( url );
DataOutputStream out = con.openDataOutputStream();
retStr = "Hello World"; //This is a message with english and chinese characters
out.writeUTF(retStr);
out.write(0x0A); //print & line feed
Thread.sleep(500);
out.flush();
out.close();
con.close();
Similar Threads
-
Transfering files over Bluetooth (with javax.bluetooth)
By weber10 in forum CLDC and MIDPReplies: 0Last Post: 02-26-2009, 08:14 PM -
How to change paper source or printer tray of a printer in java code
By JAVA_ER in forum Advanced JavaReplies: 2Last Post: 02-20-2009, 07:25 AM -
Specifying a Network Printer in Printer Servlet
By shapez in forum New To JavaReplies: 0Last Post: 03-06-2008, 03:21 PM -
Writing UTF to file using writeUTF
By Java Tip in forum Java TipReplies: 0Last Post: 01-22-2008, 08:19 PM -
please help on java program for printer : this printer is connected to system which
By for453 in forum Java 2DReplies: 0Last Post: 08-09-2007, 06:30 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks