Loading ...
Sorry, an error occurred while loading the content.

Looking for a CUPS/lp/HP printer expert

Expand Messages
  • rstrebendt
    I have encountered a behavior of the lp command that has me baffled. Normally I just use lp to print a file on my HP LaserJet 5P printer: lp and it
    Message 1 of 8 , Jan 1, 2011
    • 0 Attachment
      I have encountered a behavior of the lp command that has me baffled.

      Normally I just use lp to print a file on my HP LaserJet 5P printer:
      lp <filename>
      and it works, but it prints using about a 14 or 16 point font, and only in portrait mode. Since lp does not let me control a number of aspects of the printed output I decided to write a shell script which would accept the filename, point size, font, and orientation as parameters; create a temporary file consisting of a set of escape sequences for the HP 5P printer derived from the input parameters, a copy of the file, and an escape sequence to eject the last page of the output; then use lp to print the temporary file. This shell script works fine but requires the file to be in Microsoft's "DOS" format.

      If the file is in "unix" format then lp prints it just fine from the command line, one file line per print line. Contrarily, if the file is in "unix" format, then the output of lp in the shell script is missing all of the "carriage returns" and prints the output using only vertical line feeds between lines, with many blank lines where the output falls beyond the right edge of the paper. If the file is in "dos" format the lp command in the shell script prints the file with both carriage returns and line feeds. However, it is a nuisance to convert files back and forth between the two formats just to print them.

      Does anyone have any insight into why lp decides the file must be in "dos" format? If anyone wants to see it, I would be happy to send a copy of the script to them as an email attachment; just tell me what email address to send it to.

      Another nuisance I ran into is the fact that the HP escape sequences for almost all of the fonts include the point size. The escape sequence for the Courier font wants the "pitch size" instead. What is the mathematical relationship between point size and pitch size?

      Rich Strebendt
    • mrkcoconnell
      ... Hi Rich, I think there may be a problem on the driver side of the printer. The driver is probably expecting the CR+LF (0x0D + 0x0A), this being a DOS and
      Message 2 of 8 , Jan 2, 2011
      • 0 Attachment
        --- In linux@yahoogroups.com, "rstrebendt" <restrebendt@...> wrote:
        >
        > I have encountered a behavior of the lp command that has me baffled.
        >
        > Normally I just use lp to print a file on my HP LaserJet 5P printer:
        > lp <filename>
        > and it works, but it prints using about a 14 or 16 point font, and only in portrait mode. Since lp does not let me control a number of aspects of the printed output I decided to write a shell script which would accept the filename, point size, font, and orientation as parameters; create a temporary file consisting of a set of escape sequences for the HP 5P printer derived from the input parameters, a copy of the file, and an escape sequence to eject the last page of the output; then use lp to print the temporary file. This shell script works fine but requires the file to be in Microsoft's "DOS" format.
        >
        > If the file is in "unix" format then lp prints it just fine from the command line, one file line per print line. Contrarily, if the file is in "unix" format, then the output of lp in the shell script is missing all of the "carriage returns" and prints the output using only vertical line feeds between lines, with many blank lines where the output falls beyond the right edge of the paper. If the file is in "dos" format the lp command in the shell script prints the file with both carriage returns and line feeds. However, it is a nuisance to convert files back and forth between the two formats just to print them.
        >
        > Does anyone have any insight into why lp decides the file must be in "dos" format? If anyone wants to see it, I would be happy to send a copy of the script to them as an email attachment; just tell me what email address to send it to.
        >
        > Another nuisance I ran into is the fact that the HP escape sequences for almost all of the fonts include the point size. The escape sequence for the Courier font wants the "pitch size" instead. What is the mathematical relationship between point size and pitch size?
        >
        > Rich Strebendt
        >
        Hi Rich,
        I think there may be a problem on the driver side of the printer. The driver is probably expecting the CR+LF (0x0D + 0x0A), this being a DOS and Windows line termination format. The Xnix files only have the LF. I have used printer in Xnix on Xnix files without any trouble, thus I suspect the driver is expecting the DOS termination. Have you checked your print configuration files the most common is /etc/printcap? I think there are other configuration files but I don't recall these...perhaps someone else remembers.
        Kevin
      • rstrebendt
        ... That is what is perplexing me. If I just issue the command lp filename at a command prompt, the file prints properly (albeit without allowing me to
        Message 3 of 8 , Jan 2, 2011
        • 0 Attachment
          --- In linux@yahoogroups.com, "mrkcoconnell" <mrkcoconnell@...> wrote:
          >
          > --- In linux@yahoogroups.com, "rstrebendt" <restrebendt@> wrote:
          > >
          > > I have encountered a behavior of the lp command that has me
          > > baffled.
          > >
          >
          > I think there may be a problem on the driver side of the printer.
          > The driver is probably expecting the CR+LF (0x0D + 0x0A), this
          > being a DOS and Windows line termination format. The Xnix files
          > only have the LF.

          That is what is perplexing me. If I just issue the command "lp filename" at a command prompt, the file prints properly (albeit without allowing me to control some aspects of the printout, such as orientation). If I issue a similar command "lp ~/Temp/filename" within a bash script, lp behaves as you indicate -- printing "dos" format files correctly and munging the printout of "unix" files. Something in lp seems to be deciding which format the file has and whether or not an additional CR is needed on each line.

          > I have used printer in Xnix on Xnix files without any trouble,

          Likewise. I have had this printer hooked up to two Linux boxes over the past half-dozen years. It prints fine from within an application (such as OpenOffice or Vim), and it prints fine from the command line (though I cannot control the font used or the paper orientation). The only time it appears to have been Microsoftized is printing within the bash script I wrote. Clearly, something I am adding to the file in the HP printer escape sequences is doing something unfortunate, but I have not figured out what that is. I will try to upload a copy of the file "prfile" to the Files section of this group for perusal by the members of this group.

          Rich Strebendt
        • rstrebendt
          ... I tried to upload the file but I am apparently blocked from doing so (I did not see an Add File button on the Files page). When I have some free time
          Message 4 of 8 , Jan 2, 2011
          • 0 Attachment
            --- In linux@yahoogroups.com, "rstrebendt" <restrebendt@...> wrote:
            > ... I will try to upload a copy of the file "prfile" to the Files
            > section of this group for perusal by the members of this group.

            I tried to upload the file but I am apparently blocked from doing so (I did not see an "Add File" button on the "Files" page). When I have some free time I will create a file with the <esc> (\027) characters replaced by "[ESC]" or the like, then copy this file into a message for this group.

            Rich Strebendt
          • mrkcoconnell
            ... Hi Rich, Just to make sure, could you check your BASH configuration files? Check $HOME/.bashrc, $HOME/.bash_profile, /etc/profile, and there may be
            Message 5 of 8 , Jan 3, 2011
            • 0 Attachment
              --- In linux@yahoogroups.com, "rstrebendt" <restrebendt@...> wrote:
              >
              >
              >
              > --- In linux@yahoogroups.com, "rstrebendt" <restrebendt@> wrote:
              > > ... I will try to upload a copy of the file "prfile" to the Files
              > > section of this group for perusal by the members of this group.
              >
              > I tried to upload the file but I am apparently blocked from doing so (I did not see an "Add File" button on the "Files" page). When I have some free time I will create a file with the <esc> (\027) characters replaced by "[ESC]" or the like, then copy this file into a message for this group.
              >
              > Rich Strebendt
              >
              Hi Rich,
              Just to make sure, could you check your BASH configuration files? Check $HOME/.bashrc, $HOME/.bash_profile, /etc/profile, and there may be another /etc file or two but I can't recall. I would be looking for an "mtools" setting. At times we configure an Xnix box for use on DOS files for obvious reasons.
              Kevin
            • thad_floryan
              ... Coupla things ... 1. Your 5P is PCL5-only. I prefer PostScript over all proprietary printer control langues, but I do have the complete hardcopy PCL5
              Message 6 of 8 , Jan 3, 2011
              • 0 Attachment
                --- In linux@yahoogroups.com, "rstrebendt" <restrebendt@...> wrote:
                >
                > I have encountered a behavior of the lp command that has me baffled.
                >
                > Normally I just use lp to print a file on my HP LaserJet 5P printer:
                > lp <filename>
                > [...]
                > Another nuisance I ran into is the fact that the HP escape sequences
                > for almost all of the fonts include the point size. The escape
                > sequence for the Courier font wants the "pitch size" instead. What is
                > the mathematical relationship between point size and pitch size?

                Coupla things ...

                1. Your 5P is PCL5-only. I prefer PostScript over all proprietary
                printer control langues, but I do have the complete hardcopy PCL5
                documentation set from HP totalling about 2000+ pages and comprising:

                5961-0509 PCL5 Printer Language Technical Reference Manual (huge)
                5961-0512 Printer Job Language (guessing 200 pages; HP numbers wierdly)
                5961-0510 PCL5 Comparison Guide (shows all the fonts, etc etc) 100p
                5961-0511 PCL5 Printer Language Technical Quick Reference Guide

                2. Hacking into HP's website (a braindamaged distortion of reality
                whose mazes of twisty little passages go nowhere), I found the latest
                copies of PCL5 documentation that you may wish to download:

                PCL 5 Printer Language Technical Quick Reference Guide, 3.3MB:
                <http://h20000.www2.hp.com/bc/docs/support/SupportManual/bpl13205/bpl13205.pdf>

                PCL 5 Comparison Guide (*SUPER* useful and very important) 17.3MB:
                <http://h20000.www2.hp.com/bc/docs/support/SupportManual/bpl13206/bpl13206.pdf>

                hpPCL/PJL reference printer job language technical reference addendum, 3.1MB:
                <http://h20000.www2.hp.com/bc/docs/support/SupportManual/bpl13207/bpl13207.pdf>

                Printer Job Language Technical Reference Manual, 2.9MB:
                <http://h20000.www2.hp.com/bc/docs/support/SupportManual/bpl13208/bpl13208.pdf>

                hpPCL/PJL reference PCL 5 comparison guide addendum, 2.3MB:
                <http://h20000.www2.hp.com/bc/docs/support/SupportManual/bpl13209/bpl13209.pdf>

                PCL5 Printer Language Technical Reference Manual, Part 1, 3MB:
                <http://h20000.www2.hp.com/bc/docs/support/SupportManual/bpl13210/bpl13210.pdf>

                PCL5 Printer Language Technical Reference Manual, Part 2, 3.7MB:
                <http://h20000.www2.hp.com/bc/docs/support/SupportManual/bpl13211/bpl13211.pdf>

                PCL5 Color Technical Reference Manual, 2.4MB:
                <http://h20000.www2.hp.com/bc/docs/support/SupportManual/bpl13212/bpl13212.pdf>

                3. You may want to get the service manual for the LaserJet 5P. HP
                charges an arm-and-a-leg for it but it's a free PDF download from
                our good friends in Russia (zlathosting.net is safe, it hosts the
                eserviceinfo.com domain which I've been using to retrieve service
                manuals for years now). The service manual is a 2-part RAR archive:

                <http://www.eserviceinfo.com/downloadsm/4205/HP_Laserjet%205p/5mp%206p/6mp%20(C3150A%20/%20C3155A%20/%20C3980A%20/%20C3982A).html>

                <http://www.eserviceinfo.com/downloadsm/4206/HP_Laserjet%205p/5mp%206p/6mp%20(C3150A%20/%20C3155A%20/%20C3980A%20/%20C3982A).html>

                4. If you don't have unrar (or equivalent), get the free Peazip for
                Linux here: <http://www.peazip.org>. You probably want the graphic
                version (seriously) because I haven't a clue how to specify multiple-
                file archives to Peazip (or unrar) at the command line. In the
                "graphic" sense, just select the file range and -click to do it; it's
                automatic from that point.
              • thad_floryan
                ... I want to emphasize that if you want the PDF manuals, get them *NOW* because HP s web site is one of the world s worst websites with pages floating around
                Message 7 of 8 , Jan 3, 2011
                • 0 Attachment
                  --- In linux@yahoogroups.com, "thad_floryan" <thad@...> wrote:
                  > [...]
                  > 2. Hacking into HP's website (a braindamaged distortion of reality
                  > whose mazes of twisty little passages go nowhere), I found the latest
                  > copies of PCL5 documentation that you may wish to download:

                  I want to emphasize that if you want the PDF manuals, get them *NOW*
                  because HP's web site is one of the world's worst websites with pages
                  floating around in the cloud and dissipating and disappearing.

                  I firmly believe all HP's webmasters are the world's heaviest users
                  of crack, LSD and meth. It's my experience over decades that HP's
                  website has at least 40% dead links.

                  Want one example of HP braindamage? Part 2 of the PCL5 Printer
                  Language Technical Reference Manual cannot be found by any means on
                  HP's site or via Google, Bing, Yahoo, Ixquick, etc. I found it by
                  incrementing the directory and PDF file number and doing a wget.

                  If you download Part 1 of that manual (bpl13210.pdf), the cover page
                  has this text "Click here to access Part II on hp.com". Clicking that
                  attempts to find:

                  <http://h200007.www2.hp.com/bc/docs/support/SupportManual/bpl13211/bpl13211.pdf>

                  which doesn't exist-- h200007.www2.hp.com is not on the 'Net.

                  That sort of problem is common at hp.com. If anyone here is using
                  any HP gear, better get your PDF manuals now before they're gone.
                  They often cannot be found searching from HP's website (braindamage)
                  but this strategy often works with Google -- search for:

                  modelnamenumber manual download +PDF

                  and it'll frequently be seen to be available within the first 10 or
                  so search results pages.
                • thad_floryan
                  ... After a couple of beers, several of us here (at my home) thought it d be good sport to test HP s web page. The World Wide Web Consortium (W3C) is an
                  Message 8 of 8 , Jan 3, 2011
                  • 0 Attachment
                    --- In linux@yahoogroups.com, "thad_floryan" <thad@...> wrote:
                    > [...]
                    > I want to emphasize that if you want the PDF manuals, get them *NOW*
                    > because HP's web site is one of the world's worst websites with pages
                    > floating around in the cloud and dissipating and disappearing.
                    >
                    > I firmly believe all HP's webmasters are the world's heaviest users
                    > of crack, LSD and meth. It's my experience over decades that HP's
                    > website has at least 40% dead links.
                    > [...]

                    After a couple of beers, several of us here (at my home) thought it'd
                    be good sport to test HP's web page.

                    The World Wide Web Consortium (W3C) is an international community where
                    Member organizations, a full-time staff, and the public work together
                    to develop Web standards.

                    The W3C's web validator is <http://validator.w3.org/>.

                    Feeding hp.com into it, we quickly receive:

                    "102 Errors, 12 warning(s)"

                    I rest my case! :-)

                    And what's funny is there's a huge HP logo on the W3C page along with
                    this text:

                    " The W3C validators are hosted on server technology donated by HP,
                    " and supported by community donations.

                    HP has singlehandedly redefined "WWW" to be "World's Worst Website".

                    ROTFLMAO! :-)

                    Happy New Year 2011 Everyone!
                  Your message has been successfully submitted and would be delivered to recipients shortly.