SUMMARY: Printing AnswerBook files

From: sys013@aberdeen.ac.uk
Date: Mon Jan 16 1995 - 23:31:25 CST


Folks,

Thanks for all the replies. There are a number of utilities which apply
themselves to this job, but I suspect that none will solve the problem that
I have, which is that my JL4Si WONT print these files, but the old LJ3Si will,
so its down to differences in the postscript engines. It must lie somewhere
in the 'grestore' procedure whach is all that separates the end of one page
from the beginning of the next. As I said previously, the first 3 pages are OK,
and then 'duplexmode' gets lost.

Being a pragmatist, I'm using the 3Si from now on, and I've passed the buck.
Our Postscript Guru is continuing to investigate.

Anyway, thanks to...

bern@TI.Uni-Trier.DE (Jochen Bern)
mikem@centerline.com
   (Who also has a problem with his LJ4Si)
aflundi@sandia.gov (Alan F Lundin)
   (Who submitted a Perl script for inserting 'duplexmode' in ps files.
    see below)
blu@jericho.mc.com (Brian Utterback)
   (Who pointed at 'pslpr', a program available from ftp.adobe.com)
Jeff Dorsz <jdorsz@RDataSys.COM>
   (Who suggested a program called hpdup )
paulo@dcc.unicamp.br (Paulo Licio de Geus)
Mark.Hickey@ov.com
   (Who submitted the short Bourne script below)
worsham@aer.com (Robert D. Worsham)
   (Who suggested using HP`s JetAdmin software)

NB I didn't test either of the scripts below...
-------------------------------------------------------------------------
Gordon Robertson, Head of Systems, Aberdeen University Computing Centre
Tel +44(0)224 273340
E-Mail : g.robertson@abdn.ac.uk
--------------------------------------------------------------------------
  
 ----- Cut Here ----- ps_duplex.sh ------ Cut Here -----
#!/bin/sh
# Assume each arguement is the name of a PS file, and we are in a pipeline to
# lpr. Make the files print double-sided.
#
sed '/^%%EndProlog/a\
statusdict begin true setduplexmode end
' $*
----- Cut Here ----- ps_duplex.sh ------ Cut Here -----

NOTE: I didn't write this, so if it doesn't work, I don't know why.
Mark.
--------------------------Cut Here-----------------------------
#!/usr/local/bin/perl

($progname)= $0 =~ /.*\/([^\/]*)/;
$usage="$progname [ filename ]";

$duplex="statusdict begin true setduplexmode end
         statusdict begin false settumble end\n";
$tumble="statusdict begin true setduplexmode end
         statusdict begin true settumble end\n";
$end= "statusdict begin false setduplexmode end\n";

require 'getopts.pl';
&Getopts('dD');
die "$usage\n" if $opt_h;
die "$usage\n" if @ARGV >= 2;

if (@ARGV) {
        close(STDIN);
        $filename=shift @ARGV;
        open(STDIN, $filename) || die "Can't open $filename";
}

$line=<>;
if ($_ !~ /^%!PS-Adobe-[0-9]/) {
        print "%!PS-Adobe-1.0\n";
} else {
        print $_;
}

if ($opt_d) {
        print $duplex;
} elsif ($opt_D) {
        print $tumble;
}

while (<>) {
        print;
}

print $end;
--------------------------Cut Here-----------------------------



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:10:14 CDT