How does your procedure fail? Does it provoke an error or simply
produce no pages (or wrong pages)?
There are a few other points to consider:
- You do a bare-naked save, which is likely to fail in this context.
The save operator puts a saveobject on the stack, which is very likely
going to be removed by the code that you are executing from the disk.
Better is to give the save object a name:
/mySave save def
...
...
mySave restore
- Note that 0 0 translate and 1 1 scale are effectively no-ops.
- As a bit more bulletproofing, you should probably clean up the
operand and dictionary stacks after each executed file. A reasonable
replacement for your procedure might be something like this:
/mypart {
/oldstate save def % Note this gives us a "free" gsave
translate
rotate 0 -2834.64 translate
/showpage {} def
/setpagedevice /pop load def
exch run %(BBox of file is 200 x 2834.64)
clear % Clear operand stack
cleardictstack % Clean up dict stack
oldstate restore
Incidentally, I think your approach is fundamentally solid. You are
doing your translates & rotates correctly, as fare as I can see.
By the way, there are a couple of Acumen Journal articles you might
find useful:
Issue 4, March 2001 - Concatenating PostScript Files
Issue 36, Nov 2004 - Using EPS File in Handwritten Code
The Journal is free for the downloading at
www.acumentraining.com/acumenjournal.html
--
========
John Deubert
Acumen Training
PostScript & PDF Engineering Classes & Consulting
www.acumentraining.com
Learn PostScript programming techniques
Read the free Acumen Journal
www.acumentraining.com/acumenjournal.html