LaserJets and 11x17 paper

LaserJets and 11x17 paper

Post by Duan » Sat, 27 May 2000 04:00:00



Howdy,

I recently tried to print to a PCL Laserjet on 11x17 paper, and
discovered that this does not appear to be a trivial task. I prowled
around the news archives and found messages from people with the same
problem, but no solutions. And nothing in any FAQs or elsewhere in my
web searches. The ghostscript documentation says to use
-sPAPERSIZE=11x17, but on my PCL printer, this will cause the printer to
DEMAND the "A3" paper tray.

I spent a lot of time digging into ghostscript, and eventually made
things work. But if anyone has more info on this, please post!

So without further ado, here is what I found, and how I made things
work. Digging into the ghostscript source, it appears to me that problem
is in the file src/gdevpcl.c . This file contains this function:

/* Get the paper size code, based on width and height. */
int
gdev_pcl_paper_size(gx_device * dev)
{
    float height_inches = dev->height / dev->y_pixels_per_inch;

    return
        (height_inches >= 44.4 ? PAPER_SIZE_A0 :
         height_inches >= 32.0 ? PAPER_SIZE_A1 :
         height_inches >= 22.2 ? PAPER_SIZE_A2 :
         height_inches >= 15.9 ? PAPER_SIZE_A3 :
         height_inches >= 11.8 ? PAPER_SIZE_LEGAL :
         height_inches >= 11.1 ? PAPER_SIZE_A4 :
         PAPER_SIZE_LETTER);

Quote:}

What appears to be happening is that when you specify -sPAPERSIZE=11x17,
this functions goes through the various selections of paper sizes, and
selects the one that will fit the specified size. With
-sPAPERSIZE=11x17, the function finds that 17 >= 15.9, so it is
PAPER_SIZE_A3. And so gs inserts the PCL code for A3 paper into the
document (by the function hpjet_print_page in gdevdjet.c). Exactly the
results we are getting.

And of course, you have probably already noticed that there is no 11x17
entry in that function!!!

So here is what I did. I modified that function to add a TABLOID (11x17)
entry:

/* Get the paper size code, based on width and height. */
int
gdev_pcl_paper_size(gx_device * dev)
{
    float height_inches = dev->height / dev->y_pixels_per_inch;

    return
        (height_inches >= 44.4 ? PAPER_SIZE_A0 :
         height_inches >= 32.0 ? PAPER_SIZE_A1 :
         height_inches >= 22.2 ? PAPER_SIZE_A2 :
         height_inches >= 16.0 ? PAPER_SIZE_TABLOID :
         height_inches >= 15.9 ? PAPER_SIZE_A3 :
         height_inches >= 11.8 ? PAPER_SIZE_LEGAL :
         height_inches >= 11.1 ? PAPER_SIZE_A4 :
         PAPER_SIZE_LETTER);

Quote:}

Then I added a define for PAPER_SIZE_TABLOID to src/gdevpcl.h. This maps
the paper size to a PCL code. This may not be the same for every
Laserjet printer, so check your documentation. In the back of the User's
manual for the LaserJet 4V, there is a section on "Frequently Used PCL
Printer Commands". There it says the PCL code for 11x17 is "11". So in
src/gdevpcl.h, I added the entry:

#define PAPER_SIZE_TABLOID 11

Finally, I made one more change which I don't think makes any
difference, but I did not take it out to make sure. So for what it's
worth, here it is. In the file gdevmeds.c, there is a long table of
paper sizes, and I inserted the entry:
        X("tabloid",      11 INCH,      17 INCH),
I thought that this would allow me to specify  -sPAPERSIZE=tabloid, but
it didn't work. However, nothing has broken yet, so it appears to be a
harmless change.

Finally, of course, all this stuff has to be compiled. I downloaded the
latest GS-6.01 (and jpeg, zlib, and libpng libraries), and made my
changes there, and then compiled and installed it. It looks like a lot
of work, but in fact everything compiled "right out of the box" once I
got the makefile from:
 ftp://ykbsb2.yk.psu.edu/pub/ghost/GS-6.01/

It looks like all the latest sources are there too, but I had already
downloaded all of them from elsewhere.

One last thing, unless you have a really fast computer, once you type
"make" in the gs6.01 directory, you might as well go get a cup of
coffee. It will be QUITE a while before it finishes.

--

 
 
 

LaserJets and 11x17 paper

Post by Duan » Sun, 28 May 2000 04:00:00


Just to reply to my own posting...

Duane wrote a bunch of stuff including:

Quote:> ...

> So here is what I did. I modified that function to add a TABLOID (11x17)
> entry:

> /* Get the paper size code, based on width and height. */
> int
> gdev_pcl_paper_size(gx_device * dev)
> {
>     float height_inches = dev->height / dev->y_pixels_per_inch;

>     return
>         (height_inches >= 44.4 ? PAPER_SIZE_A0 :
>          height_inches >= 32.0 ? PAPER_SIZE_A1 :
>          height_inches >= 22.2 ? PAPER_SIZE_A2 :
>          height_inches >= 16.0 ? PAPER_SIZE_TABLOID :
>          height_inches >= 15.9 ? PAPER_SIZE_A3 :
>          height_inches >= 11.8 ? PAPER_SIZE_LEGAL :
>          height_inches >= 11.1 ? PAPER_SIZE_A4 :
>          PAPER_SIZE_LETTER);
> }

Looking at these numbers and doing my own calculations, it appears to me
that some of them are wrong. So here is what I think the correct numbers
should be, based on these paper sizes in inches:
A0       46.8
A1       33.1
A2       23.4
Tabloid  17.0
A3       16.5
Legal    14.0
A4       11.7
Letter   11.0

/* Get the paper size code, based on width and height. */
int
gdev_pcl_paper_size(gx_device * dev)
{
    float height_inches = dev->height / dev->y_pixels_per_inch;

    return
        (height_inches >= 33.2 ? PAPER_SIZE_A0 :
         height_inches >= 23.5 ? PAPER_SIZE_A1 :
         height_inches >= 17.1 ? PAPER_SIZE_A2 :
         height_inches >= 16.6 ? PAPER_SIZE_TABLOID :
         height_inches >= 14.1 ? PAPER_SIZE_A3 :
         height_inches >= 11.8 ? PAPER_SIZE_LEGAL :
         height_inches >= 11.1 ? PAPER_SIZE_A4 :
         PAPER_SIZE_LETTER);

Quote:}

Probably some notes on printing are in order. Also, I will attempt to
create an RPM and make it available hopefully later today; it appears
that the Aladdin license makes that legal.

I created a printer using printtool. I named the printer "tabloid", then
in the Select dialog I selected the non postscript Laserjet 4/5/6,
600x600 resolution, and ledger paper (which apparently doesn't do
anything). Then in the box at the bottom labeled "Extra GS options", I
entered the string:
-sPAPERSIZE=11x17

And now I can print with "lpr -Ptabloid filename.ps".

Another thing I have found. I received a schematic as a postscript file
that was set up for letter size paper, but caused eye strain to read
(this is what got me going on this in the first place). I tried to
figure out how to scale it up in gv, but never figured out a way to do
that.

Instead I did "ps2pdf filename.ps", which created a PDF file. Then I
opened it in Acroread and went to Page Setup... and selected Tabloid
paper. Then to Print... where I make the print command "/usr/bin/lpr
-Ptabloid" and click on the "Fit to Page" button, and wallah, I get a
schematic I can actually read.

--


 
 
 

LaserJets and 11x17 paper

Post by Duan » Sun, 28 May 2000 04:00:00


Just to reply to my own posting yet again...

Duane wrote a bunch of stuff in reference to making ghostscript print to
11x17 paper on PCL LaserJet printers, including:

Quote:> ... I will attempt to
> create an RPM and make it available hopefully later today; it appears
> that the Aladdin license makes that legal.

The files I created (both source and binaries) are on the web at:
 http://www.leewardfpga.com/tips.html

They are based on Ghostscript version 6.01, obtained from
 ftp://ftp.cs.wisc.edu/ghost/aladdin/gs601/linux/
with the binaries compiled under Redhat 6.1.

--

 
 
 

1. HP5000 Driver to Support TABLOID (11x17) paper

Can anyone give me some pointers as to modification of the existing
HP4000/5000 or even 4 drivers to fool smit into allowing 11x17 paper in a
pre-determined tray?  Only choices in the scripting provided is A4, letter,
legal, and exec;  however, the output device is capable of rendering 11x17"
output.

Steve Ryder
Senior Systems Consultant         AIX Certified Specialist
Penlieu Consultants Inc.
905.602.9600 x225
Please remove the nospamplease from the reply to address before replying
using mail.
Genius without education is like silver in the mine. Benjamin Franklin.

2. fdisk can't see hard disk on IBM ThinkPad

3. 5SI MX prints on 11x17 paper

4. What is a good distribution?

5. Printing on LaserJet: keep asking for wrong paper size

6. Linux is not Unix

7. HP LaserJet 4L paper problem

8. Need magic entry for ELF binaries

9. Paper tray on HP laserjet

10. Paper position on LaserJet 6L under Redhat 4.2?

11. Samba 1.9.18p8, HP laserjet 5, and a blank sheet of paper.

12. AGAIN: Paper position on LaserJet 6L under Redhat 4.2?

13. Setting Paper Tray for a LaserJet 5 SiMX