Re: USB Ports

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi,

"mr_unreliable" <kindlyReplyToNewsgroup@xxxxxxxxxxx> wrote in message
news:uL93xFvcHHA.4004@xxxxxxxxxxxxxxxxxxxxxxx
hi Soho,

If your printer is an "old-fashioned" (text) printer,
then all you need to do is copy your text file to
the device name. But, (most of) those "old-fashioned"
printers are now sleeping in land-fills.

For the more modern printers, which print dots instead
of text, you need to "install" the printer (device and
device driver) on your system. After a quick google,
it appears that zebra printers are thermal printers,
meaning they probably print dots.

A lot of the old dot matrix printers defaulted to printing the correct dot
pattern to produce the character when you send it a character like the
letter 'n'. Sending an escape sequence could change font or turn on
underline mode or set other attributes. So if DOS detected the printer as
being on lpt1, for instance, you could copy a text file to lpt1 in DOS, and
the printer would produce the text. These printers often had an escape
sequence that would switch them into graphics mode, in which case you had to
send the correct byte patterns to get the desired dots to print.

If your printer wasn't installed before, your system
should detect that there is a new device attached, and
either pick out an appropriate driver for you, or ask
you to provide one. If you don't have a driver handy,
zebra will most likely have one available for downloading
at it's website.

Finally, to get the file printed, you are going to have
to send it through the system spooler, which will call
the driver to convert your text to an appropriate pattern
of dots to send to the print.

I'm a little fuzzy on this myself, so correct me if I'm wrong.
I think if you wanted to print a text file to this printer, you could open
the file in Notepad, for instance, and click the print item on the file
menu, select the printer (which is on some usb port nested some level of
hubs from the computer), and click the print button. At this point, I
believe Notepad sends the text to the printer driver, which converts
Notepad's output to the printer's language input format, but sends it to the
spooler. The spooler then ques this 'printer language' data and sends it
'unchanged' to the USB drivers which may encapsulate it in packets that wend
their way through the USB hubs to the printer. The printer unencapsulates
the data and processes it to produce the text on the paper.

Sometimes, a person may have reason to choose 'print to file' in the
printing dialog. This just saves the 'printer language' data from the
printer driver to a file, which could later be spooled to any printer that
understands that particular 'printer language'. I have done this with DOS
copy to lpt1 back in the early Windows days. But I haven't found a way to
do it to a USB printer out on some hub somewhere, except through a Windows
spooler utility.

I often use such a free 'spooler', called PrintFile from
http://www.lerup.com/printfile/. It was designed to send native postscript
to a postscript printer, but I know it will send postscript, after a
warning, to an HP USB PCL printer. This printer also understands
postscript, so I get the desired result. I assume it would send any file's
contents to any printer, with the warning.

Here's another point I'm a little fuzzy on. In PrintFile, you have to
specify which Windows printer you are spooling to. PrintFile must be asking
the driver if it is truely a postscript printer. In my case, when windows
detected my printer, it only installed the PCL driver, not the Postscript
driver. So PrintFile thinks it is spooling the data to a non-postscript
printer, but informs the driver to NOT translate to PCL -- just send the raw
data to the selected printer. Is it a requirement that Windows printer
drivers have a way for its users to pass unmodified input to the OS's
spooler?

Is PrintFile really a spooler or just an intermediary that tells the driver
whether or not to pass on the data unchanged?

If the zebra printer is your "default" printer, then you
can just rt-click on the text file and select print. If
you want to do this via script, use shell.run:

oShell.Run "notepad /p myPath\myFile.txt"

If the zebra printer is _not_ your default printer, then
you are going beyond my scripting knowledge. For a "pure"
scripting approach, you might try instantiating microsoft
word ("Word.Application"), opening the text file, selecting
your usb printer, and then just printing it.

As for myself, in those situations where I want to print
to a non-default printer, I use an api print utility -- but
calling system api's is not something that a professional
scripter would ever consider. (As an amateur, I am not
bothered by the compulsions of professionals).

-Paul Randall


.


Quantcast