Bug 78450 - bad level 1 postscript output
bad level 1 postscript output
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: ghostscript (Show other bugs)
8.0
i586 Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-11-22 18:54 EST by Need Real Name
Modified: 2008-05-01 11:38 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-11-26 09:54:18 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Imvalid level1 ps generated by printing from Linux Mozilla. (55.08 KB, text/plain)
2002-11-25 00:35 EST, Need Real Name
no flags Details
Valid level1 postscript generated by printing from Windows Mozilla. (134.29 KB, text/plain)
2002-11-25 00:38 EST, Need Real Name
no flags Details
Please try this file on the printer. (18.12 KB, application/octet-stream)
2002-11-25 13:19 EST, Alex Cherepanov
no flags Details
Please try this on the printer (19.02 KB, application/octet-stream)
2002-11-25 15:24 EST, Alex Cherepanov
no flags Details
patch for GS 8.00 (4.72 KB, patch)
2002-11-25 21:12 EST, Alex Cherepanov
no flags Details | Diff
Patch for ESP GhostScript 7.05.5 (current CVS) (2.33 KB, patch)
2002-11-26 09:36 EST, Till Kamppeter
no flags Details | Diff

  None (edit)
Description Need Real Name 2002-11-22 18:54:56 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.3a) Gecko/20021120

Description of problem:
My postscript laser printer (Oki OL840) does not have a configuration entry
under LPRng nor under CUPS. By itself this isn't neccessarily a showstopper if
there is a working generic postscript. However, the available generic postscript
driver does *NOT* offer an option for pre-converting postscript level 2/3 to
level 1 prior to printing. This means that only level1 postscript can be printed
even though many apps generate level2 and have no internal setting for
conversion. The postscript level conversion option is presented for many other
printer types and should definitely be present for the generic postscript driver.

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


How reproducible:
Always

Steps to Reproduce:
Impossible to properly configure printing for the Oki OL840 postscript (level 1)
printer.
	

Actual Results:  Postscript level2 is not converted to level1 and therefore
isn't printed.

Expected Results:  A postscript driver whether specific for the OL840 or the
generic postscript driver should include the option of pre-converting level 2/3
to level 1.

Additional info:
Comment 1 Need Real Name 2002-11-25 00:35:28 EST
Created attachment 86265 [details]
Imvalid level1 ps generated by printing from Linux Mozilla.
Comment 2 Need Real Name 2002-11-25 00:38:31 EST
Created attachment 86266 [details]
Valid level1 postscript generated by printing from Windows Mozilla.
Comment 3 Need Real Name 2002-11-25 00:51:05 EST
Till Kamppeter at linuxprinting.org provided a generic postscript driver that
has the needed level2->level1 pre-filtering option for the driver (see
discussion thread "generic ps driver that converts level2 to level1" in the
linuxprinting.general forum at http://www.linuxprinting.org). I have tested this
extensively. Unfortunately it fails to remedy the problem because ghostscript
7.05 is generating invalid level1 postscript. The 2 attachments were generated
by printing the same web page using Mozilla running under Linux and Windows. The
Linux generated ps does not print (even under Windows), but the Windows version
prints flawlessly. Both versions can be viewed via gv, but the Linux version has
very noticeably degraded quality. I'll report this to the ghostscript
maintainers, but please don't wait on them. Please take some initiative in
correcting this faulty component present in your distribution. Thank you.
Comment 4 Tim Waugh 2002-11-25 12:05:40 EST
'printer-config' is the wrong component to use.  Correcting.
Comment 5 Tim Waugh 2002-11-25 12:06:04 EST
Reassigning.
Comment 6 Alex Cherepanov 2002-11-25 13:19:37 EST
Created attachment 86364 [details]
Please try this file on the printer.
Comment 7 Alex Cherepanov 2002-11-25 13:24:25 EST
I confirm that there is a problem in pdfwrite driver in Ghostscript.
The driver alloactes insufficient space for the image cache. Please try the
attached file on the printer. The file increases page dictionary size 
to 197 entries.
Comment 8 Need Real Name 2002-11-25 14:07:17 EST
Here's the results of trying to print lin801.ps:

1. Under Linux with old default Postscript driver (has no prefiltering option):
produces blank sheet of paper

2. Under Linux with T. Kamppeter's Generic Postscript driver (has prefiltering
option): nothing printed

3. Under Windows 2000: prints, but the result is of poor quality 

I'm not sure what can be concluded from this. There is definitely a postscript
problem, but is there also another problem with the printing system? Why doesn't
the stock RH8 Postscript driver print this when Windows is able to??
Comment 9 Till Kamppeter 2002-11-25 14:11:26 EST
I can display lin801.ps with gv (ESP GhostScript 7.05.5 on Mandrake 9.0) and can
also print it on the HP LaserJet 4050 by simply sending it to the printer
without any filters. Probably this is the fix and we should patch GhostScript
appropriately. If it affects also PDF creation the fix is even much more
important, as nearly everyone creates PDFs, but only very few people have an old
PostScript Level 1 printer.
Comment 10 Need Real Name 2002-11-25 14:44:30 EST
My first test with lin801.ps was without a filter. It failed. Also a comparison
of lin801.ps vs. l1ps_win.ps makes it obvious that there is a serious quality
problem with gs. Old printer or not, why is it that Windows 2000 can print
correctly but Linux can't?? I don't see how based on the evidence I presented
anyone can reach the conclusion that this "is the fix". From my perspective
nothing has been fixed.
Comment 11 Alex Cherepanov 2002-11-25 15:22:39 EST
lin801.ps is a PostScript file. You don't need any PS drivers to print it on a
PS printer -- just lpr it to the right queue. This file has a larger dictionary to
avoid dictfull error. This fix doesn't affect PDF at all. Please try lin802.ps.
Besides larger dictionary it uses procedure data source instead of string data
source and has an error handler.
Comment 12 Alex Cherepanov 2002-11-25 15:24:55 EST
Created attachment 86386 [details]
Please try this on the printer
Comment 13 Need Real Name 2002-11-25 18:19:51 EST
Yes, I'm perfectly aware the lin801.ps is postscript. When you setup a print
queue using redhat-config-printer you are asked to select a driver. There's no
getting around that. And I obviously need one since I need the level2->level1
pre-filtering. Actually it's lpdomatic that does this, but it gets installed
along with the Generic Postscript driver. 

Here's the result of printing lin802.ps:

1. Prints under Linux with the default LPRng Postscript driver. Poor hardcopy
quality though (compare to l1ps_win.ps hardcopy).

2. Does *NOT* print under Linux with Generic Postscript driver neither with
pre-filtering enabled nor disabled.

I'll take being able to print for now if I can get it. How do I obtain the gs
patch and apply it (gs 7.05 was installed from rpm)? Unfortunately the initial
impediment of not being able to convert level2 to level1 remains.

Before I conclude this post perhaps you could entertain some naive questions.
What accounts for the stark difference is ps structure between l1ps_win vs.
lin801/802, and how does that relate to the hardcopy quality? Can gs do what
seems to be done in Windows, a compatibility mode perhaps?

My thanks to everyone, especially Till & Alex for their prompt attention to this
thorny problem.
Comment 14 Alex Cherepanov 2002-11-25 21:10:23 EST
lin801/802.ps files were derived from l1ps_linux.ps generated by Mozilla on Linux.
l1ps_win.ps was generated by Pscript.dll Version 5.0. These files look different
and the file generated on Windows looks better. You cannot blame Ghostscript for
this.

Attached is a patch aganst current CVS code that allocates larger dictionary and
uses a procedure instead of a string as a data source for the image operator.
That's all that can be done on Ghostscript side.

I'd consider working on other aspects of this problem as a consulting project.


Comment 15 Alex Cherepanov 2002-11-25 21:12:07 EST
Created attachment 86446 [details]
patch for GS 8.00
Comment 16 Need Real Name 2002-11-26 00:51:48 EST
Thanks. I'm not sure why I can't blame ghostscript for substandard quality
though. Am I the first person on the planet who has conceived of comparing gs
postscript to postscript generated by other means for the purpose of determining
quality? We have 2 different tools that should produce the same thing. One is
not even close to the other. That's the one to fix. It's as simple as that.

Will this patch show up in an official release of GS ?
Comment 17 Till Kamppeter 2002-11-26 09:36:28 EST
Created attachment 86526 [details]
Patch for ESP GhostScript 7.05.5 (current CVS)
Comment 18 Till Kamppeter 2002-11-26 09:54:11 EST
I have created now a version of the "dictfull.diff" patch for the current CVS of
ESP GhostScript, it probably also works with GNU GhostScript 7.05.

I didn't find any real problem with GhostScript, I can display all four files
attached to this bug with ESP GhostScript 7.05.5 with and without patch. I can
also convert them to level 1 with or without patch, using the command line

cat file.ps | gs -q -dPARANOIDSAFER -dNOPAUSE -dBATCH -sDEVICE=pswrite
-dLanguageLevel=1 -sOutputFile=- - >testfile

and I can always display the resulting "testfile" files with gv (using ESP
GhostScript 7.05.5). I have no Level 1 PostScript printer to check whether the
resulting files are really level 1. So I want to ask you to try the following:

Print with the following command line all four attached files:

cat file.ps | gs -q -dPARANOIDSAFER -dNOPAUSE -dBATCH -sDEVICE=pswrite
-dLanguageLevel=1 -sOutputFile=- - > /dev/lp0

(I assume that the printer is on the first parallel port). Does this work? What
does the printer do?

If it works (please tell, if so), there must be a problem with the
spooler/Foomatic configuration. To find it, edit /usr/sbin/lpdomatic (or
whereever the "lpdomatic" filter script is under Red Hat) replacing "my
$debug=0;" with "my $debug=1;" and then send the job again (using the queue
which you have set up with the driver with Level2 -> Level1 conversion, check
whether the "Perfilter" option is really set to "Level1") and then attach your
/tmp/prnlog or /tmp/lpdomatic.log file to this bug. Then I could see whether
there is a problem with lpdomatic or the driver data.

The bad quality of the Mozilla output I would consider to be another bug which
is independent of the PostScript-Level-1-not-being-printed bug, so a new bug (a
Mozilla bug) should be filed to treat this. These should perhaps be better
placed on the Bugzilla of Mozilla, because it does not only affect Red Hat Linux.
Comment 19 Tim Waugh 2002-11-26 13:23:24 EST
ghostscript-7.05-25, which will appear in rawhide shortly, has this patch applied.
Comment 20 Need Real Name 2002-11-26 17:17:18 EST
Unfortunately my schedule is completely overloaded right now so I won't be able
to follow up on the latest suggestions until 11/28. I have downloaded the
7.05-24 source, it built cleanly but doesn't execute ("Unrecoverable error:
undefinedfilename in metrics2.ps"). It sure would be nice if the source rpms
contained source code with the patches already applied so that an immediate make
produces the same binary as which is contained in the binary rpm. I'm not sure
how someone should decide which patches to apply and in what order. Once I can
build a functional binary I'll add the patch. Before that I'll try Till's
recommendations. As for our gracious hosts they're probably correct to close
this for now. I'll definitely try out gs 7.05-25, but we might have this
resolved before then. I'll correspond with Till directly regarding the follow-up
to his recommendations. Thanks to all for helping to resolve this and happy
holidays.
Comment 21 Till Kamppeter 2002-11-26 17:23:46 EST
I have applied the patch to the CVS of ESP GhostScript now, so ESP GhostScript
7.05.6 will be the first GhostScript release with this patch applied.

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