2

We have two Epson TMU 220 (USB) printers and try to print from two different clients. One is an Ubuntu client and another is a Windows client. Using PHP, In Ubuntu I echo plain text to /dev/usb/lp0 and it all comes out fine. Standard fixed-width font in good size. Being new to receipt printing, I do not know how to add format but this is not a problem at this moment - I just need plain receipts.

Now, in Windows I have no idea how to 'echo' to the printer. But in Windows there are drivers available (which is not the case for Ubuntu). So the OS recognizes the printer and it shows up for users. Now, I have users in Windows use the FILE > PRINT option in Firefox (it is a web-based system) to print to the receipt printer. But here is the trick. Obviously my output was plain text rendered as HTML so newlines are not taken into consideration. To fix this, I put a "pre" tag ahead of the text. It now outlines perfectly fine. However, when printed on Windows the font is very small, hardly readable.

How to change this? I tried:

  • Using CSS to change the font-size. But as it says "Adjust to page" when printing, it is always reduced to a tiny size.
  • Changing the "Adjust to page" setting and leaving it at 100%. Now text does not fit on the receipt (not all columns are printed).
  • Changing the font used, using different Courier versions. No results.

Anybody any idea how to get the text size to increase? (Or, how to directly print plain text on Windows to this printer... that would also fix it)...

Thanks!

Jonas
  • 121,568
  • 97
  • 310
  • 388

1 Answers1

0

It appears that you've got a plain text file; in that case you could use a text editor to open and print the document, rather than a browser. Notepad is an option included with every version of Windows, or you could install a better editor (I prefer EditPlus, but there are many many options available).

You can also try copying the file to the PRN or LPT1 device, similar to what you do on Linux, but this may not work because most print drivers don't set themselves up as old DOS-style printer ports. I've seen discussions of sharing the printer, then connecting to it using NET USE LPT1: \printer\sharename, but I haven't had any need to try that myself.

Steven
  • 1
  • 1
    Thanks, but I have to print this from the browser, as this is part of a browser-based application. –  Apr 08 '11 at 12:59