in reply to PRINT AN IMAGE TO LPT1

Instead of hacking this yourself and getting it wrong, you might try setting up an lpd daemon to interact with the printer in between. Then you can use Net::Printer or LinePrinter without problems. Dot Matrix printers (as far as I know) never accepted HTML headers or PostScript (I found it amusing that you actually tried that :o). Depending on its age, it will use some obscure code that you won't find anywhere or on some Russian guy's web page who spent two years of his life reverse-engineering his printer (?). The only solution is to be happy with text or interact with the printer drivers in some manner. Also, you might even get to make an "older form of anti-aliased" text simply by using the drivers instead. lpd is the only thing that would make sense.... have fun.
AgentM Systems nor Nasca Enterprises nor Bone::Easy nor Macperl is responsible for the comments made by AgentM. Remember, you can build any logical system with NOR.

Replies are listed 'Best First'.
Re: Re: PRINT AN IMAGE TO LPT1
by Fastolfe (Vicar) on Nov 18, 2000 at 04:28 UTC
    Wouldn't it be kind of nifty to have a printer that spoke HTTP though? I've seen some that did FTP (you'd FTP your job to the printer, and off it'd go) and lpd natively. HTTP should be quite capable of accepting a POST or a PUT request...
      This reminds me. Most people don't know it, but PostScript is actually a full-fledged programming language, and a PostScript document is actually a program that causes the printer to print the desired document.

      Just to demonstrate this, a PostScript printer is a computer with an operating system written in PostScript. If you send it the right document, you can actually reprogram the printer. This will only work if you know how to program in PostScript (there are books) and if you know the correct password (there are well-known defaults).

      So you could write your own http server if you wanted!

      BTW have you secured your PostScript printer lately?

      I'd imagine that keeping the printer drivers up to speed on the HTML "standards" would be more difficult than converting the whole shebang into PostScript in the first place:o) i.e. it might be nifty but entirely undpendable. lpd is reliable and easy to use- I see no excuse not to use it. While I agree it might be amusing, it wouldn't be much more than that.... Update: Oh. sorry, I read it too quickly. But I still disagree. Implementing a full-blown HTTP server wouldn't be too slick either- it's better to go through drivers. Such a server would completely complication any user authentication...
      AgentM Systems nor Nasca Enterprises nor Bone::Easy nor Macperl is responsible for the comments made by AgentM. Remember, you can build any logical system with NOR.
        At my last job we had a fine Lexmark printer that would allow FTP:
        Ruby#~> ftp elroy.xxxx.xxx
        Connected to elroy.xxxx.xxx
        220 FTP server: Lexmark Optra N Laser Printer ready
        Name (elroy.xxxx.xxx:root):
        230 user root logged in
        ftp> quit
        221 Goodbye

        And is still wide open to the internet because they never remember to set the root password after the kung-fu reset wipes the prom.

        Aside from that in no way does having FTP help you unless you have already prepared your "document" for printing with either "epson", "postscript", "wingraphics", or "lexmarkian" formats. (actually I think some can do PDF too). Having a HTTP file-upload "CGI" in there would be pretty cool and in-fact some printers on the market allow HTTP configuration, testing, and job loading already. You just upload an already prepared print format and off you go! Sexy and fun and easily abused if people keep erasing the root password when they deep-reset the machine.

        And what printer does authentication? One with a builtin print-spooler? Why couldn't the HTTPd and FTPd both use the same authentication set as the built-in print-spooler?

        --
        $you = new YOU;
        honk() if $you->love(perl)

        Just because it uses HTTP doesn't mean it has to speak HTML. HTTP is pretty standard and held at version 1.1 for several years... I didn't mean to suggest that printers should render HTML (though that might be nifty as well).. :)
Re: Re: PRINT AN IMAGE TO LPT1
by jepri (Parson) on Nov 18, 2000 at 19:56 UTC
    Watch out for that condescending thing... I find it amusing that you suggest lpd could print to a dot-matrix. lpd only deals in postscript. I had to toss my dot matrix when I went Linux, but I haven't looked back.

    ____________________
    Jeremy

      Now I know that's not true at all. lpd handles any printer considering that a driver is available for it. I know this because I have used several OLD printers which I know never supported PS. lpd interacts with the drivers and does nothing else except to block on printer requests which then interacts with the driver appropriately.
      AgentM Systems nor Nasca Enterprises nor Bone::Easy nor Macperl is responsible for the comments made by AgentM. Remember, you can build any logical system with NOR.
        OK, I should definately do my research before mouthing off. A quick look at the Linux Printer Howto will answer all the questions crazyinsomniac had and possibly a lot more. If he isn't using Linux then some well researched API calls will probably do the trick.

        ____________________
        Jeremy
        I didn't believe in evil until I dated it.

(crazyinsomniac) Re: Re: PRINT AN IMAGE TO LPT1
by crazyinsomniac (Prior) on Nov 18, 2000 at 04:32 UTC
    You thought that was funny, so did i, but it can't hurt to try. Anyway all i am running is ActiveState's ActivePerl on a win98 machine. I am not running any kind server much less a print one.

    The two modules you mentioned look like the same thing, and they also say "Please note that this module only talks to print servers that speak BSD." if that's of any significance to you. Like i said what i'm interested in more is interfacing to the printer(pdd) so i can make api calls 'n such.

    "cRaZy is co01, but sometimes cRaZy is cRaZy".
                                                          - crazyinsomniac