how to print multiple pages on one page 
Author Message
 how to print multiple pages on one page

I once wrote a program to generate an "load-average" plot for a UNIX system.
This program now runs on many machines, each one producing a single page plot.
We run the program with the 'rsh' interface from one computer catching the
output from each into the same file which is then sent to the LaserWriter
for output.  The problem was that we were generating 70+ pager per run, which
was wasteful and unmanagable.  Since we are getting even more computers (work
stations) in the near future, we had to find a solution.  The soltution was to
cram 9 plots into a single page.  The problem with this was we wanted to do it
without changing the C program that generates the postscript data.  The way
I did it was to override a few of the PostScript operators with my own
procedures.  I based this on the fact that I had exactely one  'clippath' call
at the start of a single page output and either 'showpage' or 'erasepage
initgraphics' at the end.  The following code will do what is needed.  The
only thing to make note of is that 'showpage' should be called an extra
8 times at the end of the postscript in order to flush the last page (anyone
have a better idea?  Something that could be set up at the start to trap
the 'end-of-job' condition?).

- Yossie

---
% place this code segment before the collection of output pages.
% place a file with eight 'showpage's at the end.
/Initgraphics {initgraphics} bind def
/initgraphics {} def
/Erasepage {erasepage} bind def
/erasepage {Clippath pathbbox 1 setgray fill} def
/Showpage {showpage} bind def
/showpage {
        Which 1 add 9 mod dup /Which exch def
        0 eq {Showpage} if

Quote:
} def

/Clippath {clippath} bind def
/clippath {
        Initgraphics 1 3 div dup scale
        Clippath pathbbox
        2 index sub 3 div dup 5 1 roll 2 Which 3 mod sub mul exch
        3 index sub 3 div dup 6 1 roll 2 Which 3 idiv sub mul exch
        translate translate 2 copy
        newpath 0 0 moveto 0 exch lineto exch lineto 0 lineto 0 0 lineto clip
Quote:
} def

/Which 0 def
--
Yossie Silverman                                   What did the Caspian sea?
National Semiconductor Ltd. (Israel)

NSA LSD FBI KGB PCP CIA MOSAD NUCLEAR MI5 SPY ASSASSINATE SDI -- OOCLAY ITAY


Thu, 17 Dec 1992 08:23:00 GMT  
 how to print multiple pages on one page

Quote:
> The
> only thing to make note of is that 'showpage' should be called an extra
> 8 times at the end of the postscript in order to flush the last page (anyone
> have a better idea?  Something that could be set up at the start to trap
> the 'end-of-job' condition?).

How about adding a definition along the lines of:

/Flushpages { Which 0 neq { Showpage } if } def

This does a "real" showpage if the last page hasn't.

--
Amanda Walker
InterCon Systems Corporation
--



Thu, 17 Dec 1992 16:57:00 GMT  
 how to print multiple pages on one page

.> The
.> only thing to make note of is that 'showpage' should be called an extra
.> 8 times at the end of the postscript in order to flush the last page (anyone
.> have a better idea?  Something that could be set up at the start to trap
.> the 'end-of-job' condition?).
.
.How about adding a definition along the lines of:
.
./Flushpages { Which 0 neq { Showpage } if } def
.
.This does a "real" showpage if the last page hasn't.
.
.--
.Amanda Walker
.InterCon Systems Corporation
.--

And is about as long as typing 'showpage' 8 times.  No, I am looking for
something that can set at the START of the header and will take effect at
the END of the job.  It's not really that important...      - Yossie
--
Yossie Silverman                                   What did the Caspian sea?
National Semiconductor Ltd. (Israel)

NSA LSD FBI KGB PCP CIA MOSAD NUCLEAR MI5 SPY ASSASSINATE SDI -- OOCLAY ITAY



Thu, 17 Dec 1992 07:19:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Printing Multiple Pages on One Page

2. Help: Printing one logical page to multiple physical pages

3. psnup -- print multiple page images to one physical page

4. Printing one page over multiple pages (inverse psnup)

5. Printing multiple pages from one page

6. multiple pages on one page

7. Overlay Multiple Pages onto One Page?

8. multiple pages on one A4 page ?

9. multiple pages on one page : REQUEST.

10. printing multiple pages on one with Windows 3.1 and Postscript

11. How can I print one page multiple times?

12. printing multiple ps files on one physical page.

 

 
Powered by phpBB® Forum Software