The problem is the source contains control character. Those control characters is invisible in Notepad. Text file viewer such as notepad does not display text in proper format.
For example(\r\n are control characters which are invisible in notepad):
Originial
AAAAAA 123.00\r
BBBBBBB\r\n
Final Result
AAAAAA BBBBBBB 123.00\r\n
The term seems to be “overprinting”.
Is there any way to convert such a String?
Or is there any way to simulate a printer that print such text?
Sample Code
String text = getUnformatedText();
BufferedWriter bw = new BufferedWriter(new FileWriter(new File("text.txt")));
bw.write(text);
bw.flush();
I have created a project at Google Project Hosting. The code works with my situation.
http://code.google.com/p/printing-control-text-to-notepad-ready/