PCL3 codes for programming - Hewlett Packard

This is a discussion on PCL3 codes for programming - Hewlett Packard ; Hi, For quite some time I've been trying to print on a DeskJet 940C from a MySQL database using Linux/Perl. Until now, using WP Office and a DeskJet 520, all text is printed nicely with e.g. arial 10dpi but I ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: PCL3 codes for programming

  1. PCL3 codes for programming

    Hi,

    For quite some time I've been trying to print on a DeskJet 940C from a
    MySQL database using Linux/Perl. Until now, using WP Office and a
    DeskJet 520, all text is printed nicely with e.g. arial 10dpi but I want
    to get all things opensource. So far, when printing from Perl and using
    some found PCL codes that should be correct, the text is printed too
    large and in the wrong fonttype. Can someone please provide me with a
    link to a PCL3 manual in which all codes are given so I can get it fixed?

    Thanks for your help.

    Huub

  2. Re: PCL3 codes for programming

    ....snip...

    Writing your own printer driver in Perl is NOT the way to go! You should
    investigate what printer interfaces Linux has and be using those. Drivers,
    whether for printers, screens or most other devices are where you start to
    have to be platform specific.

    That said, some languages (such as Java) have abstraction libraries that you
    can write to. Someone else writes the translation from abstraction to
    Linux/Windows/ whilst you write to the abstraction layer
    interface (which is all portable code).

    So, see what abstraction layers you can find that will allow you to do this.
    Don't get delving into PCL3 because then you'll end up tying yourself to HP
    printers, and maybe even the specific model, if you're not careful - and
    that's hardly open ;-).

    Paul DS.



  3. Re: PCL3 codes for programming

    Yes! Linux has perfectly fine drivers and support for HP DeskJets, PostScript
    printers, and some other printers. I've never done any Linux programming, but
    there has to be a standard high-level printer API, just as there is for
    Windows... Ben Myers

    On Wed, 7 Mar 2007 09:06:11 -0000, "Paul D.Smith"
    wrote:

    >...snip...
    >
    >Writing your own printer driver in Perl is NOT the way to go! You should
    >investigate what printer interfaces Linux has and be using those. Drivers,
    >whether for printers, screens or most other devices are where you start to
    >have to be platform specific.
    >
    >That said, some languages (such as Java) have abstraction libraries that you
    >can write to. Someone else writes the translation from abstraction to
    >Linux/Windows/ whilst you write to the abstraction layer
    >interface (which is all portable code).
    >
    >So, see what abstraction layers you can find that will allow you to do this.
    >Don't get delving into PCL3 because then you'll end up tying yourself to HP
    >printers, and maybe even the specific model, if you're not careful - and
    >that's hardly open ;-).
    >
    >Paul DS.
    >


  4. Re: PCL3 codes for programming

    On Mon, 05 Mar 2007 09:59:56 +0100, Huub <"v.niekerk at hccnet.nl">
    wrote:

    >Hi,
    >
    >For quite some time I've been trying to print on a DeskJet 940C from a
    >MySQL database using Linux/Perl. Until now, using WP Office and a
    >DeskJet 520, all text is printed nicely with e.g. arial 10dpi but I want
    >to get all things opensource. So far, when printing from Perl and using
    >some found PCL codes that should be correct, the text is printed too
    >large and in the wrong fonttype. Can someone please provide me with a
    >link to a PCL3 manual in which all codes are given so I can get it fixed?
    >
    >Thanks for your help.
    >
    >Huub


    I notice in a Google lookup that there's a PCL3 output module for the
    open source program Ghostscript. (Ghostscript interprets Postscript
    and Adobe PDF files.)

    This is distributed as source code. So perhaps having the source code
    for a printer driver would be useful in learning PCL3.

    http://home.vrweb.de/martin.lottermoser/pcl3.html

    --
    Posted via a free Usenet account from http://www.teranews.com


  5. Re: PCL3 codes for programming

    Ben Myers wrote:
    > Yes! Linux has perfectly fine drivers and support for HP DeskJets, PostScript
    > printers, and some other printers. I've never done any Linux programming, but
    > there has to be a standard high-level printer API, just as there is for
    > Windows... Ben Myers
    >


    So what would you suggest in this case of printing from Perl? Printing
    to file and then printing the file using e.g. gs -sDeskJet520=pcl3
    ?

  6. Re: PCL3 codes for programming

    That would certainly be much cleaner than having Perl emit PCL codes
    interspersed with what ever else is being printed. And it would be easy to
    change the printer, in the event that the Deskjet520 failed and was replaced by
    another printer... Ben Myers

    On Sat, 10 Mar 2007 22:15:03 +0100, Huub <"v.niekerk at hccnet.nl"> wrote:

    >Ben Myers wrote:
    >> Yes! Linux has perfectly fine drivers and support for HP DeskJets, PostScript
    >> printers, and some other printers. I've never done any Linux programming, but
    >> there has to be a standard high-level printer API, just as there is for
    >> Windows... Ben Myers
    >>

    >
    >So what would you suggest in this case of printing from Perl? Printing
    >to file and then printing the file using e.g. gs -sDeskJet520=pcl3
    >?


  7. Re: PCL3 codes for programming

    Huub <"v.niekerk at hccnet.nl"> wrote:

    > Ben Myers wrote:
    >> Yes! Linux has perfectly fine drivers and support for HP DeskJets,
    >> PostScript
    >> printers, and some other printers. I've never done any Linux
    >> programming, but there has to be a standard high-level printer API, just
    >> as there is for Windows... Ben Myers
    >>

    >
    > So what would you suggest in this case of printing from Perl? Printing
    > to file and then printing the file using e.g. gs -sDeskJet520=pcl3
    > ?


    Using lp rather than gs may make more sense.


  8. Re: PCL3 codes for programming

    Huub <"v.niekerk at hccnet.nl"> wrote:
    > Ben Myers wrote:
    >> Yes! Linux has perfectly fine drivers and support for HP DeskJets, PostScript
    >> printers, and some other printers. I've never done any Linux programming, but
    >> there has to be a standard high-level printer API, just as there is for
    >> Windows... Ben Myers

    >
    > So what would you suggest in this case of printing from Perl? Printing
    > to file and then printing the file using e.g. gs -sDeskJet520=pcl3
    >?


    The best way is to generate PostScript output. PostScript is device-
    and resolution-independent, and can be easily converted to PDF or about
    any type of bitmap output.

    If you don't want to generate low-level PS by yourself, there are Perl
    modules that may be useful, like PostScript::Simple.

    --
    Warren Block * Rapid City, South Dakota * USA

+ Reply to Thread