> 1) Merge two postcript files.  I'm trying to run a
> small script that converts the text output from
> another program into Postscript, and then merge that
> file with a previously createed postscript file.
>
> Here's the script segment that does these things :-
>
> ----------- Begin Script Segment ------------------
> for $source.*
> do
>  cat "$file" | enscript -p/tmp/outfile.ps -R -B
>  cat /u/psback.ps /tmp/outfile.ps | lpr -PHPLaser
> done
> ------------ End Script Segment -------------------
>
> The HP Laser is a fully postscript capable printer, I
> can print both files seperately, and the files are
> able to merge print on a SCO box, but under linux the
> files seem to not want to merge.
>
> psback.ps is a background image that is needed
> "behind" every page printed.
>
> source.* is a collection of single pages (organised
> through another section of the script, quite simple
> really).
>
> Comments about this will be greatly appreciated.  All
> help useful.

Actually, this is probably more of a PostScript problem than a Linux
problem. In this case, though, I think the difference in behavior (between
the two UNIX systems) may be attributable to enscript. (I.e., no flames
please.)

Generally PostScript files are not appendable in this way. Now, maybe
psback.ps is specially designed to be used in that way, but the typical way
a PostScript programmer would have to make that work (modifying the showpage
function) is dependent on how the file that follows is prepared, and whether
*it* modifies the showpage function. (Typical reason a PostScript generator
might modify this function: implementing page numbering.)

I think what's probably happening here is that the version of enscript on
the system where this *does* work must generate a different (simpler)
PostScript prologue than the version on your Debian system. Namely, that
version of enscript probably doesn't modify the showpage function itself.

Under this theory, what would be happening is

    psback.ps executes its code and modifies the
        showpage function (probably) to lay down
        the background first, then the rest of the
        page

    your enscript output comes along and undoes
        those modifications

and voila, you get the symptoms you didn't describe 8), which are probably
either a) no output or b) same output as enscripting alone. Right?

Unfortunately, the fix for this problem (assuming that's what it is) is not
that easy. It would probably involve reworking psback.ps to a more reliable
implementation, or reworking enscript's prologue to make it more tolerant of
psback.ps.

For experimentation, I would also recommend trying to view the file with
ghostscript, and also moving it off the system and printing it from various
places (PCs, Macs, whatever you have around. If the symptoms are all the
same, then I think you can be assured the problem is in fact something like
I suggest rather than the Debian lpd, and you might want to consider
reposting in a PostScript forum.

Sorry if any of this sounds vague. Unless you know PostScript the details
aren't that helpful.

c

Reply via email to