Bug 56503
Summary: | psnup produces incorrect output | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Kevin Range <range006> | ||||||||
Component: | psutils | Assignee: | Martin Bacovsky <mbacovsk> | ||||||||
Status: | CLOSED NOTABUG | QA Contact: | |||||||||
Severity: | low | Docs Contact: | |||||||||
Priority: | medium | ||||||||||
Version: | rawhide | CC: | alexcher, gleblanc, mattdm, peter.englmaier | ||||||||
Target Milestone: | --- | ||||||||||
Target Release: | --- | ||||||||||
Hardware: | All | ||||||||||
OS: | Linux | ||||||||||
Whiteboard: | |||||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||||
Doc Text: | Story Points: | --- | |||||||||
Clone Of: | Environment: | ||||||||||
Last Closed: | 2006-12-13 18:17:08 UTC | Type: | --- | ||||||||
Regression: | --- | Mount Type: | --- | ||||||||
Documentation: | --- | CRM: | |||||||||
Verified Versions: | Category: | --- | |||||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||||
Embargoed: | |||||||||||
Attachments: |
|
Description
Kevin Range
2001-11-20 03:13:53 UTC
Created attachment 37988 [details]
gnumeric print output
Created attachment 37989 [details]
psnup -2 -pletter -d foo.ps output
Created attachment 37990 [details]
mpage -2 foo.ps output
I confirm that foo2.ps is broken. I can look into this problem closer if Red Hat agrees to support the project. Reconfirmed that this is still broken on FC3 with psutils-1.17-19. [rangek@asimov psnup]$ psnup -2 -pletter -d foo.ps foo_new.ps [1] Wrote 1 pages, 55400 bytes [rangek@asimov psnup]$ diff -u foo2bad.ps foo_new.ps That should be psutils-1.17-23 in FC3. (I had a window on a FC9 box up.) I have a fix for this problem. It is submitted to both psnup and cups maintainers, however, it is not clear to me if the patch is accepted. The problem is in cups, not in psnup, because the postscript files print when submitted directly to the printer. However, the cups maintainer is saying that psnup is not creating complient files. The fix is to install an additional filter in cups (two files, see below) and change the filter in the /etc/cups/mime.conv file: #application/postscript application/vnd.cups-postscript 66 pstops application/postscript application/vnd.cups-postscript 66 badpstops This will make postscript files filter through the attached scripts, which just move the psutils stuff down in the %%BeginSetup section. I do not know if that makes the file perfect postscript, but at least cusp can print it. Since everyone thinks redhat should support people submitting patches, I like to comment that it took me 2 days to fix this problem. Send the money to New Orleans. File "/usr/lib/cups/filter/badpostscript": #!/usr/bin/perl -w # simple perl script to fix buggy postscript produced by psutils # (c) GNU GPL, Peter Englmaier, 2005. $mode=0; $found=0; my @saved; while (<STDIN>) { if ($mode == 0) { if ($_ =~ "%%BeginProcSet: PStoPS.*") { $mode=1; $found=1; @saved = (@saved, $_); } else { print "$_"; } } elsif ($mode == 1) { @saved = (@saved, $_); if ($_ =~ "%%EndProcSet.*") { $mode=2; } } else { print "$_"; if ($found && $_ =~ "%%BeginSetup.*") { for (@saved) { print "$_"; } $found=0; # do not repeat } } } exit 0 Wrapper script "/usr/lib/cups/badpstops" #!/bin/sh FILTERDIR=/usr/lib/cups/filter # See if we have a filename on the command-line... if test -z "$6"; then ifile="-" else ifile="$6" fi cat $ifile | $FILTERDIR/badpostscript | $FILTERDIR/pstops "$1" "$2" "$3" "$4" "$5" Fedora Core 3 is now maintained by the Fedora Legacy project for security updates only. If this problem is a security issue, please reopen and reassign to the Fedora Legacy product. If it is not a security issue and hasn't been resolved in the current FC5 updates or in the FC6 test release, reopen and change the version to match. Please try to reproduce this bug with latest version of psutils in FC5. Otherwise I'm going to close this bug FWW, here is what cupstestdsc (the CUPS utility for checking PostScript DSC validity) says about the original gnumeric output: foo.ps: FAIL Bad %%Page: on line 23! REF: Page 53, %%Page: Bad %%Page: on line 2289! REF: Page 53, %%Page: Missing or bad %%BoundingBox: comment! REF: Page 39, %%BoundingBox: Missing or bad %%Pages: comment! REF: Page 43, %%Pages: Missing or bad %%Page: comments! REF: Page 53, %%Page: Warning: obsolete DSC version 2.0 in file! Warning: no %%EndComments comment in file! Closing this as NOTABUG seems just plain wrong. What is the motivation behind this change? |