You should be able to use print.exe to print a text file.
Thank you for the response Erel and steve105. Print.exe is a print utility going back to the days of MS-DOS. It’s not all that useful today due to a number of limitations. As far as I know, it will only output to LPT and COM ports. Those of us with USB printers are out of luck. Even when used to print to a parallel or serial printer, you can’t simply output to the default printer. You must direct output to a specific port. I don’t see it as a practical means of printing from within an application.
I have been able to print the contents of an HTML file from my app using the PrintHtml utility. In printing a multiline text PrintHtml cannot see the line breaks, and prints all text as one line. When I open the HTML file in Notepad++ it displays correctly as multiline text, and Notepad++ will also print the text as multiline.
In that I’m using File.WriteList I have no means of replacing line characters, if that is what PrintHtml requires. So, I think I will have to give up on this. Hopefully B4J will include a more refined print utility in a future release.
Happy New Year