Bug 85553 - Network printers print postscript commands
Summary: Network printers print postscript commands
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: foomatic
Version: 8.0
Hardware: i686
OS: Linux
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Brock Organ
Depends On:
TreeView+ depends on / blocked
Reported: 2003-03-04 11:52 UTC by Laurence Page
Modified: 2007-04-18 16:51 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2003-03-06 10:29:55 UTC

Attachments (Terms of Use)
printconf-tui --Xexport outoput as requested (5.70 KB, text/plain)
2003-03-04 12:59 UTC, Laurence Page
no flags Details
Here's the patch I'm about to commit upstream. (4.37 KB, patch)
2003-03-05 12:43 UTC, Tim Waugh
no flags Details | Diff
comment.patch (867 bytes, patch)
2003-03-05 16:27 UTC, Tim Waugh
no flags Details | Diff

Description Laurence Page 2003-03-04 11:52:09 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130

Description of problem:
Network Printers configured using the gnome printer configuration gui as (for
Queue Type:     UNIX Printer (lpd queue)
Server:         Canon
Queue:          print
Printer:        GP405
Printer Driver: Postscript

a simple command such as:


will print out 5 pages of postscript commands.

Version-Release number of selected component (if applicable): LPRng-3.8.9-6

How reproducible:

Steps to Reproduce:
1.Define a UNIX network (postscript) printer (using default settings)
2.print a test page to it
3.collect a weeks supply of scrap paper

Actual Results:  the printer prints the Postscript commands

Expected Results:  It should print a test page

Additional info:

The same printer(s) works fine from RH7.1 & RH7.2 (and spooling from RH8.0 via a
RH7.1 m/c works fine)

Comment 1 Tim Waugh 2003-03-04 12:06:34 UTC
Which driver do you use in Red Hat Linux 7.2?

Comment 2 Laurence Page 2003-03-04 12:27:19 UTC
RH7.1 uses the Canon GP405/Postscript driver with LPRng-3.7.4-2

The only difference in configuration I can find is in the
/var/spool/lpd/canon/mf.cfg file which has a '-d' switch in the PSfilter for
RH7.1.  I have tried adding this in RH8.0 but not got consistent results.

Comment 3 Tim Waugh 2003-03-04 12:42:59 UTC
On the 8.0 machine please run 'printconf-tui --Xexport' and attach the result. 

Comment 4 Laurence Page 2003-03-04 12:59:24 UTC
Created attachment 90460 [details]
printconf-tui --Xexport outoput as requested

The printer definition I has set up for testing is softtest.

Comment 5 Tim Waugh 2003-03-04 13:22:01 UTC
Are you printing the test page from the redhat-config-printer tool?  I wonder if
enabling the 'prerender PostScript' option would make a difference here.

Comment 6 Laurence Page 2003-03-04 14:39:04 UTC
Pre-rendering just prints out the postscript commands for the bitmap instead.

If I switch the printer from 'PostScript' to 'Raw Printer Driver' I can print
postscript files correctly (though no other file type will print).  I therefore
suspect the header that is being added to the postscript file by the postscript
driver.  What I see printed ahead of my postscript data is:
<</HWResolution[600 600]>> setpagedevice
<</Duplex false>>setpagedevice
<</PageSize [595 842] /ImagingBBox null>> setpagedevice

Then my own postscript data continues:


Is it possible that something else is being added before the %! (unprinted) that
is confusing the printer?  Is there a way of trapping the print file just before
it gets sent to the printer?

Comment 7 Tim Waugh 2003-03-04 15:23:06 UTC
You can set it up as a local printer and set the custom device to '/dev/lp0'
(create that file and make 'lp' own it).

Another thing you can try is to edit the /usr/sbin/lpdomatic script and change
'my $debug = 0;' to 'my $debug = 1;'.  Then when you print you will end up with
some useful output in /tmp.

Comment 8 Laurence Page 2003-03-04 16:49:44 UTC
That has tracked the problem down.  The printer doesn't like the HWResolution

I have trapped the output using /dev/lp0 and created a raw printer.  Printing
the trapped data prints the postscript commands.  Commenting out the
HWResolution line works OK.

On further investigation this does just seem to be a problem wirh the Canon
GP405.   How can I stop lp adding in the HWResolution line?

Comment 9 Tim Waugh 2003-03-04 17:13:59 UTC
Did you comment out *just* the HWResolution line?  I've seen problems with the
duplex line before (bug #82385).  Could it possibly be that?

Otherwise I'll need to add a 'do nothing' value to that resolution foomatic
option, like I did for duplex.

Comment 10 Laurence Page 2003-03-04 17:21:09 UTC
It was just the HWResolution (probably a canon bug).  The header that prints OK is:

%% <</HWResolution[600 600]>>setpagedevice
<</Duplex false>>setpagedevice
<</PageSize[595 842]/ImagingBBox null>>setpagedevice

Comment 11 Tim Waugh 2003-03-04 18:50:35 UTC
I've mentioned this to the upstream foomatic maintainer.

Comment 12 Tim Waugh 2003-03-05 12:43:40 UTC
Created attachment 90475 [details]
Here's the patch I'm about to commit upstream.

Apply with 'patch -i resolution.patch

Comment 13 Laurence Page 2003-03-05 15:29:59 UTC
Sorry, but you aren't going to like this.  I have applied your patch but it
still wouldn't work.  Further investigation reveals that in order to work the
commented out HWResolution line needed to be present.  With the line deleted it
fails to print again.  An empty comment doesn't fix it either but any comment
with text in it after the %! makes it all work.

I will report this to Canon as well.

%% %%
<</HWResolution[600 600]>> setpagedevice
<</Duplex false>>setpagedevice
<</PageSize[595 842]/ImagingBBox null>>setpagedevice

<</HWResolution[600 600]>> setpagedevice
<</Duplex false>>setpagedevice
<</PageSize[595 842]/ImagingBBox null>>setpagedevice

<</HWResolution[600 600]>> setpagedevice
<</Duplex false>>setpagedevice
<</PageSize[595 842]/ImagingBBox null>>setpagedevice

Comment 14 Tim Waugh 2003-03-05 16:27:00 UTC
Created attachment 90477 [details]

Here's a patch intended to add '%% %%' in the right place.  What a weird Canon

Comment 15 Tim Waugh 2003-03-05 16:27:44 UTC
(I should mention that it applies to
/usr/share/foomatic/db/source/driver/Postscript.xml this time.)

Comment 16 Laurence Page 2003-03-06 10:11:38 UTC
That patch didn't wouldn't apply to my Postscript.xml file but I have hand
edited the change in and all seems to be well.  Thanks for your help.

Comment 17 Tim Waugh 2003-03-06 10:29:55 UTC
Great.  This change is applied in upstream foomatic CVS.

Note You need to log in before you can comment on or make changes to this bug.