PriNet has asked for the wisdom of the Perl Monks concerning the following question:

I did quite a bit of searching on how to print to a USB printer on the internet and it looks like Printer::ESCPOS was the best choice for me, if anyone has any idea of something "better" PLEASE let me know because I'm having a problem the the mentioned package, I could not find a way to get the vendor id and product id to initialize the printer. The only thing I found was "lsusb" - which I think is a nix command. I of course am using windoz (XP). Is there any way in perl to get these vendor and product id's (so i can find printers if the script is used on a different computer ?)

I tried re-inventing the wheel again, but everytime I push it, it still falls flat on it's side...

Replies are listed 'Best First'.
Re: Printing to USB printer
by FreeBeerReekingMonk (Deacon) on Nov 10, 2016 at 20:27 UTC
    Well, I always used the commandline to print to a printer. But you had to set it up first in Windows itself (i.e. windows drivers have to be installed for your specific USB printer).

    Ultimately, just put everything in a text file and use the commandline command print to print

    Of course, this prints to LPT1, so you need how-do-i-simulate-a-parallel-lpt-printer-with-a-usb-printer.

Re: Printing to USB printer
by ww (Archbishop) on Nov 10, 2016 at 16:11 UTC

    Have you read the documentation?

    Alternately, if you've installed it, read the doc from the command prompt (terminal) using $ perldoc Printer::ESCPOS.

    You'll also benefit from reading some suggestions about how to post questions here: On asking for help and How do I post a question effectively?. And studying the markup directions wouldn't hurt, either.

    Downvoted for a lazy post by a Monk of sufficient longevity to have known better.

    Questions containing the words "doesn't work" (or their moral equivalent) will usually get a downvote from me unless accompanied by:
    1. code
    2. verbatim error and/or warning messages
    3. a coherent explanation of what "doesn't work actually means.