From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2) Gecko/20010808 Description of problem: While normally quite superior to mpage, I have found a postscript file which psnup fails to properly process. Instead of taking my two page ps file and making it into one "2 per page" ps file, I get a one page ps file that looks half right, but produces two pages when printed, one of garbage and one half right. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. run psnup -pletter -2 -d foo.ps > foo2.ps 2. gv foo2.ps and see it looks okay 3. lpr -h foo2.ps and get two pages. Actual Results: Two pages, one half right and one of garbage Expected Results: one page, "2 per paged" Additional info: The postscript file was made by gnumeric 0.61. maybe it is abug there?
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?