[cups.general] eps printing broken - FIXED

David Bishop dbishop at micron.com
Thu Jun 29 16:24:52 PDT 2006


> I tested your file and got a blank page.
> Then I commented out these lines in oyur file:
> <<
>     /HWResolution [300 300]
>     /Policies << /PageSize 5>>
>
>  >> setpagedevice
>
> and then the file printed OK.
> printing the original file directly (using the hpnpf stand alone utility
> or, alternative, ftp) to the printer, even the unmodified file came out OK.

[For posterity's sake]

To recap this thread, everything is now working.  I did end up using a custom 
filter, which runs all postscript through the following (thanks to Helge, and 
my brother who wrote the regular expression).  

#!/usr/bin/perl -w

use strict;

if (@ARGV == 6) {
    my $filename = $ARGV[5];
    open(STDIN, $filename) or die "ERROR: $filename: $!\n";
}

my $input_file;
{ local $/ = undef; $input_file = <STDIN>; }

$input_file =~ s|
    << \s*
    /HWResolution .+? \s*
    /Policies .+? \s*
    >> \s* setpagedevice \s*
||gx;

$input_file =~ s/\s*%BoundingBox/%%BoundingBox/;
$input_file =~ s/^\s+%%/%%/;

print $input_file;

#END SCRIPT

To enable this, I made the following files:

postscript.types:
application/vnd.my-eps          prn eps ps

postscript.convs:
application/postscript  application/vnd.my-eps  0      ps2ps
application/vnd.my-eps  application/vnd.cups-postscript 33      pstops


If there is a better way to do this, I'm all ears.  But I'm pretty happy with 
this.  It doesn't seem to put much of a strain on our server, and it should 
be fairly clear what's going on when I stumble across it in a year and wonder 
what the heck I was doing :-)
-- 
Some people remind me of slinkies.  Completely useless,
but it's fun to push them down the stairs. (Anon)

David Bishop





More information about the cups mailing list