home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume35 / psutils / patch01 / Patch1.7-1.8
Text File  |  1993-03-04  |  19KB  |  650 lines

  1. diff -c -r +new-file psutils-dist/LICENSE psutils/LICENSE
  2. *** psutils-dist/LICENSE    Mon Feb  8 11:33:39 1993
  3. --- psutils/LICENSE    Wed Feb 10 13:59:08 1993
  4. ***************
  5. *** 1,13 ****
  6.   
  7.                           PS Utilities Package
  8.   
  9. ! The constituent files of this package listed below are copyright (C) 1991,1992
  10. ! Angus J. C. Duggan.
  11.   
  12. ! Makefile        README          buffer.c        epsffit.c       fixfmps
  13. ! fixmacps        fixpspps        getafm          magic.c         psbook.1
  14. ! psbook.c        psnup           psnup.1         psselect.1      psselect.c
  15. ! pstops.1        pstops.c        psutil.c        psutil.h        showchar
  16.   
  17.   They may be copied and used for any purpose (including distribution as part of
  18.   a for-profit product), provided:
  19. --- 1,14 ----
  20.   
  21.                           PS Utilities Package
  22.   
  23. ! The constituent files of this package listed below are copyright (C) 1991,
  24. ! 1992, 1993 Angus J. C. Duggan.
  25.   
  26. ! LICENSE         Makefile        README          epsffit.c       fixfmps
  27. ! fixmacps        fixpsditps      fixpspps        fixwfwps        fixwpps
  28. ! getafm          patchlevel.h    psbook.1        psbook.c        psnup.1
  29. ! psnup.sh        psselect.1      psselect.c      pstops.1        pstops.c
  30. ! psutil.c        psutil.h        showchar
  31.   
  32.   They may be copied and used for any purpose (including distribution as part of
  33.   a for-profit product), provided:
  34. ***************
  35. *** 33,36 ****
  36.   The included files appledict.ps, md68.0.ps and md71.0.ps are (to the best of my
  37.   knowledge) copyright Apple Computer, Inc.
  38.   
  39. !                                                                 AJCD 25/3/92
  40. --- 34,37 ----
  41.   The included files appledict.ps, md68.0.ps and md71.0.ps are (to the best of my
  42.   knowledge) copyright Apple Computer, Inc.
  43.   
  44. !                                                                 AJCD 10/1/93
  45. diff -c -r +new-file psutils-dist/Makefile psutils/Makefile
  46. *** psutils-dist/Makefile    Mon Feb  8 11:33:32 1993
  47. --- psutils/Makefile    Wed Feb 10 14:49:22 1993
  48. ***************
  49. *** 1,6 ****
  50.   # Makefile for PS utilities
  51.   
  52. ! CFLAGS=-O
  53.   
  54.   # epsffit fits an epsf file to a given bounding box
  55.   # psbook rearranges pages into signatures
  56. --- 1,12 ----
  57.   # Makefile for PS utilities
  58.   
  59. ! CFLAGS=-g
  60. ! INSTALL=install -c -m 0755 
  61. ! INSTALLMAN=install -c -m 0644 
  62. ! BINDIR=/usr/local/bin
  63. ! MANDIR=/usr/local/share/man/man1
  64. ! MANEXT=1
  65. ! PAPER=a4
  66.   
  67.   # epsffit fits an epsf file to a given bounding box
  68.   # psbook rearranges pages into signatures
  69. ***************
  70. *** 7,14 ****
  71.   # psselect selects page ranges
  72.   # pstops performs general page rearrangement and merging
  73.   
  74. ! all: psbook psselect pstops epsffit
  75.   
  76.   epsffit: epsffit.c
  77.       $(CC) $(CFLAGS) -o epsffit epsffit.c
  78.   
  79. --- 13,23 ----
  80.   # psselect selects page ranges
  81.   # pstops performs general page rearrangement and merging
  82.   
  83. ! ALL = psbook psselect pstops epsffit psnup
  84. ! ALLPLUS = $(ALL) fixfmps fixmacps fixpsditps fixpspps fixwfwps fixwpps
  85.   
  86. + all: $(ALL)
  87.   epsffit: epsffit.c
  88.       $(CC) $(CFLAGS) -o epsffit epsffit.c
  89.   
  90. ***************
  91. *** 29,33 ****
  92.   
  93.   psselect.c: psutil.h patchlevel.h
  94.   
  95.   clean:
  96. !     rm -f *.o psbook psselect pstops epsffit
  97. --- 38,64 ----
  98.   
  99.   psselect.c: psutil.h patchlevel.h
  100.   
  101. + psnup: psnup.sh patchlevel.h
  102. +     r=`sed -n -e "s/^#define RELEASE \([0-9][0-9]*\)/\1/p" <patchlevel.h`; \
  103. +     p=`sed -n -e "s/^#define PATCHLEVEL \([0-9][0-9]*\)/\1/p" <patchlevel.h`; \
  104. +     sed -e "s/@PATCHLEVEL@/$$p/" -e "s/@RELEASE@/$$r/" -e "s/@PAPER@/$(PAPER)/" psnup.sh >psnup; \
  105. +     chmod 755 psnup
  106.   clean:
  107. !     rm -f *.o
  108. ! veryclean: clean
  109. !     rm -f $(ALL)
  110. ! install:
  111. !     @for i in $(ALLPLUS); do \
  112. !         echo Installing $$i; \
  113. !         $(INSTALL) $$i $(BINDIR); \
  114. !     done
  115. ! installman:
  116. !     @for i in $(ALL); do \
  117. !         echo Installing manual page for $$i; \
  118. !         $(INSTALLMAN) $$i.1 $(MANDIR)/$$i.$(MANEXT); \
  119. !     done
  120. diff -c -r +new-file psutils-dist/Manifest psutils/Manifest
  121. *** psutils-dist/Manifest    Mon Feb  8 11:33:40 1993
  122. --- psutils/Manifest    Wed Feb 10 12:52:15 1993
  123. ***************
  124. *** 2,9 ****
  125.   Makefile
  126.   Manifest
  127.   README
  128. ! patchlevel.h
  129. ! appledict.ps
  130.   epsffit.c
  131.   fixfmps
  132.   fixmacps
  133. --- 2,8 ----
  134.   Makefile
  135.   Manifest
  136.   README
  137. ! epsffit.1
  138.   epsffit.c
  139.   fixfmps
  140.   fixmacps
  141. ***************
  142. *** 14,23 ****
  143.   getafm
  144.   md68.0.ps
  145.   md71.0.ps
  146.   psbook.1
  147.   psbook.c
  148. - psnup
  149.   psnup.1
  150.   psselect.1
  151.   psselect.c
  152.   pstops.1
  153. --- 13,23 ----
  154.   getafm
  155.   md68.0.ps
  156.   md71.0.ps
  157. + patchlevel.h
  158.   psbook.1
  159.   psbook.c
  160.   psnup.1
  161. + psnup.sh
  162.   psselect.1
  163.   psselect.c
  164.   pstops.1
  165. diff -c -r +new-file psutils-dist/README psutils/README
  166. *** psutils-dist/README    Mon Feb  8 11:33:18 1993
  167. --- psutils/README    Thu Feb 11 09:27:14 1993
  168. ***************
  169. *** 59,65 ****
  170.   showchar (sh)   outputs PostScript to draw a character with metric info
  171.   fixfmps  (perl) filter to fix framemaker documents so that psselect etc. work
  172.   fixwpps  (perl) filter to fix WordPerfect documents so that psselect etc. work
  173. ! fixwpps  (perl) filter to fix Word for Windows documents for psutils
  174.   fixmacps (perl) filter to fix Macintosh documents with saner version of md
  175.   fixpsditps (perl) filter to fix Transcript psdit documents to work with psutils
  176.   fixpspps (perl) filter to fix PSPrint PostScript so that psselect etc. work
  177. --- 59,65 ----
  178.   showchar (sh)   outputs PostScript to draw a character with metric info
  179.   fixfmps  (perl) filter to fix framemaker documents so that psselect etc. work
  180.   fixwpps  (perl) filter to fix WordPerfect documents so that psselect etc. work
  181. ! fixwfwps (perl) filter to fix Word for Windows documents for psutils
  182.   fixmacps (perl) filter to fix Macintosh documents with saner version of md
  183.   fixpsditps (perl) filter to fix Transcript psdit documents to work with psutils
  184.   fixpspps (perl) filter to fix PSPrint PostScript so that psselect etc. work
  185. ***************
  186. *** 83,86 ****
  187. --- 83,103 ----
  188.   This is an interim release; these utilities are currently being re-written
  189.   from scratch, with a full DSC-3.0 parser and more extraction, merging, and
  190.   inclusion options included.
  191. + ACKNOWLEDGEMENTS
  192. + Bug fixes and suggestions for improvements to PSUtils have come from many
  193. + people, including:
  194. +         Brian Colfer            brianc@labmed.ucsf.edu
  195. +         Charles A. Finnell      finnell@org.mitre.lear
  196. +         Conrad Kimball          cek@com.boeing.sdc
  197. +         J.W.Hawtin              
  198. +         Jochen Schwarze         schwarze@de.isa
  199. +         Ken Carpenter           khc@edu.ksu.eece
  200. +         Kristian Jorg           etxkrjg@se.ericsson.solsta
  201. +         Larry Weissman          larryw@nsr.bioeng.washington.edu 
  202. +         Michael L. Brown        brown%uucp.vidiot@edu.wisc.cs
  203. +         
  204. + (Apologies to anyone who I have left out.)
  205.   
  206. diff -c -r +new-file psutils-dist/epsffit.1 psutils/epsffit.1
  207. *** psutils-dist/epsffit.1
  208. --- psutils/epsffit.1    Mon Feb  8 10:35:42 1993
  209. ***************
  210. *** 0 ****
  211. --- 1,47 ----
  212. + .TH EPSFFIT 1
  213. + .SH NAME
  214. + epsffit \- fit encapsulated PostScript file (EPSF) into constrained size
  215. + .SH SYNOPSIS
  216. + .B epsffit
  217. + [
  218. + .B \-c
  219. + ]
  220. + [
  221. + .B \-r
  222. + ]
  223. + [
  224. + .B \-a
  225. + ]
  226. + [
  227. + .B \-s
  228. + ]
  229. + .I "llx lly urx ury"
  230. + [
  231. + .B file
  232. + ]
  233. + .SH DESCRIPTION
  234. + .I Epsffit
  235. + fits an EPSF file (encapsulated PostScript) to a given bounding box.
  236. + The coordinates of the box are given by \fB(llx,lly)\fR for the lower
  237. + left, and \fB(urx,ury)\fR for the upper right, in PostScript units (points).
  238. + .PP
  239. + If no file is specified,
  240. + .I epsffit
  241. + uses the standard input. Output is always to the standard output.
  242. + .SH OPTIONS
  243. + .IP \fB\-c\fP 1i
  244. + Center the image in the given bounding box.
  245. + .IP \fB\-r\fP 1i
  246. + Rotate the image by 90 degrees counter-clockwise.
  247. + .IP \fB\-a\fP 1i
  248. + Adjust the aspect ratio to fit the bounding box. The default is to preserve
  249. + the aspect ratio.
  250. + .IP \fB\-s\fP 1i
  251. + Add a \fIshowpage\fP at the end of the file to force the image to print.
  252. + .SH AUTHOR
  253. + Angus Duggan
  254. + .SH "SEE ALSO"
  255. + psbook(1), psselect(1)
  256. + .SH TRADEMARKS
  257. + .B PostScript
  258. + is a trademark of Adobe Systems Incorporated.
  259. diff -c -r +new-file psutils-dist/epsffit.c psutils/epsffit.c
  260. *** psutils-dist/epsffit.c    Mon Feb  8 11:33:40 1993
  261. --- psutils/epsffit.c    Wed Feb 10 12:47:28 1993
  262. ***************
  263. *** 2,12 ****
  264.    * AJCD 6 Dec 90
  265.    * fit epsf file into constrained size
  266.    * Usage:
  267. !  *       epsffit [-c] [-r] [-a] [-s] llx lly urx ury
  268.    *               -c centres the image in the bounding box given
  269.    *               -r rotates the image by 90 degrees anti-clockwise
  270.    *               -a alters the aspect ratio to fit the bounding box
  271.    *               -s adds a showpage at the end of the image
  272.    */
  273.   
  274.   #include <stdio.h>
  275. --- 2,14 ----
  276.    * AJCD 6 Dec 90
  277.    * fit epsf file into constrained size
  278.    * Usage:
  279. !  *       epsffit [-c] [-r] [-a] [-s] llx lly urx ury [file]
  280.    *               -c centres the image in the bounding box given
  281.    *               -r rotates the image by 90 degrees anti-clockwise
  282.    *               -a alters the aspect ratio to fit the bounding box
  283.    *               -s adds a showpage at the end of the image
  284. +  *
  285. +  * Added filename spec (from Larry Weissman) 5 Feb 93
  286.    */
  287.   
  288.   #include <stdio.h>
  289. ***************
  290. *** 21,27 ****
  291.   usage()
  292.   {
  293.      fprintf(stderr, "%s release %d patchlevel %d\n", prog, RELEASE, PATCHLEVEL);
  294. !    fprintf(stderr, "Usage: %s [-c] [-r] [-a] [-s] llx lly urx ury\n", prog);
  295.      exit(1);
  296.   }
  297.   
  298. --- 23,30 ----
  299.   usage()
  300.   {
  301.      fprintf(stderr, "%s release %d patchlevel %d\n", prog, RELEASE, PATCHLEVEL);
  302. !    fprintf(stderr, "Usage: %s [-c] [-r] [-a] [-s] llx lly urx ury [file]\n",
  303. !        prog);
  304.      exit(1);
  305.   }
  306.   
  307. ***************
  308. *** 29,40 ****
  309.        int argc;
  310.        char **argv;
  311.   {
  312. -    int fit[4], i;
  313.      int bbfound = 0;              /* %%BoundingBox: found */
  314.      int urx, ury, llx, lly;
  315.      int furx, fury, fllx, flly, fwidth, fheight;
  316.      int showpage = 0, centre = 0, rotate = 0, aspect = 0;
  317.      char buf[BUFSIZ];
  318.   
  319.      prog = *argv++; argc--;
  320.   
  321. --- 32,43 ----
  322.        int argc;
  323.        char **argv;
  324.   {
  325.      int bbfound = 0;              /* %%BoundingBox: found */
  326.      int urx, ury, llx, lly;
  327.      int furx, fury, fllx, flly, fwidth, fheight;
  328.      int showpage = 0, centre = 0, rotate = 0, aspect = 0;
  329.      char buf[BUFSIZ];
  330. +    FILE *input = stdin;
  331.   
  332.      prog = *argv++; argc--;
  333.   
  334. ***************
  335. *** 51,57 ****
  336.         argv++;
  337.      }
  338.   
  339. !    if (argc != 4) usage();
  340.      fllx = atoi(argv[0]);
  341.      flly = atoi(argv[1]);
  342.      furx = atoi(argv[2]);
  343. --- 54,60 ----
  344.         argv++;
  345.      }
  346.   
  347. !    if (argc < 4) usage();
  348.      fllx = atoi(argv[0]);
  349.      flly = atoi(argv[1]);
  350.      furx = atoi(argv[2]);
  351. ***************
  352. *** 63,70 ****
  353.         fwidth = furx - fllx;
  354.         fheight = fury - flly;
  355.      }
  356.   
  357. !    while (fgets(buf, BUFSIZ, stdin)) {
  358.         if (buf[0] == '%' && (buf[1] == '%' || buf[1] == '!')) {
  359.        /* still in comment section */
  360.        if (!strncmp(buf, "%%BoundingBox:", 14)) {
  361. --- 66,79 ----
  362.         fwidth = furx - fllx;
  363.         fheight = fury - flly;
  364.      }
  365. +    if (argc > 4) {
  366. +       if(!(input = fopen(argv[4],"r"))) {
  367. +      fprintf(stderr, "%s: Cannot open %s\n", prog, argv[4]);
  368. +      exit(1);
  369. +       }
  370. +    }
  371.   
  372. !    while (fgets(buf, BUFSIZ, input)) {
  373.         if (buf[0] == '%' && (buf[1] == '%' || buf[1] == '!')) {
  374.        /* still in comment section */
  375.        if (!strncmp(buf, "%%BoundingBox:", 14)) {
  376. ***************
  377. *** 120,126 ****
  378.      }
  379.      do {
  380.         fputs(buf,stdout);
  381. !    } while (fgets(buf, BUFSIZ, stdin));
  382.      if (bbfound) {
  383.         puts("grestore");
  384.         if (showpage)
  385. --- 129,135 ----
  386.      }
  387.      do {
  388.         fputs(buf,stdout);
  389. !    } while (fgets(buf, BUFSIZ, input));
  390.      if (bbfound) {
  391.         puts("grestore");
  392.         if (showpage)
  393. diff -c -r +new-file psutils-dist/fixfmps psutils/fixfmps
  394. *** psutils-dist/fixfmps    Mon Feb  8 11:33:41 1993
  395. --- psutils/fixfmps    Wed Feb 10 14:38:18 1993
  396. ***************
  397. *** 2,7 ****
  398. --- 2,11 ----
  399.   # fixfmps: get conforming PostScript out of FrameMaker file
  400.   # move all FMDEFINEFONTs to start of pages
  401.   
  402. + # feed this into perl
  403. + eval 'exec perl -S $0 "$@"'
  404. +    if $running_under_some_shell;
  405.   %fonts=();
  406.   
  407.   while (<>) {
  408. diff -c -r +new-file psutils-dist/fixmacps psutils/fixmacps
  409. *** psutils-dist/fixmacps    Mon Feb  8 11:33:41 1993
  410. --- psutils/fixmacps    Wed Feb 10 14:38:06 1993
  411. ***************
  412. *** 1,6 ****
  413. --- 1,10 ----
  414.   #!/usr/local/bin/perl
  415.   # fixmacps: swap to sanitised appledict
  416.   
  417. + # feed this into perl
  418. + eval 'exec perl -S $0 "$@"'
  419. +    if $running_under_some_shell;
  420.   $line = 0;            # keep line count
  421.   $dir = "/usr/local/share/tex/dvips";
  422.   $prefix = "md";
  423. ***************
  424. *** 15,20 ****
  425. --- 19,26 ----
  426.      }
  427.   }
  428.   
  429. + %fonts = ();
  430.   while (<>) {
  431.      if (/^%!/) {
  432.         if (! $line) {
  433. ***************
  434. *** 52,61 ****
  435.        print "%!\n" if !$line;
  436.        print;
  437.         }
  438.      } else {
  439.         if (! $ignore) {
  440. !      print "%!\n" if !$line;
  441. !      print;
  442.         }
  443.      }
  444.      $line++;
  445. --- 58,75 ----
  446.        print "%!\n" if !$line;
  447.        print;
  448.         }
  449. +    } elsif (/^%%Page:/) {
  450. +       print $_;
  451. +       print values(%fonts);
  452.      } else {
  453.         if (! $ignore) {
  454. !      if (/^\{\}mark .*rf$/) {
  455. !         $fonts{$_} = $_;
  456. !         print;
  457. !      } else {
  458. !         print "%!\n" if !$line;
  459. !         print;
  460. !      }
  461.         }
  462.      }
  463.      $line++;
  464. diff -c -r +new-file psutils-dist/fixpsditps psutils/fixpsditps
  465. *** psutils-dist/fixpsditps    Mon Feb  8 11:33:42 1993
  466. --- psutils/fixpsditps    Wed Feb 10 14:38:26 1993
  467. ***************
  468. *** 1,6 ****
  469. --- 1,10 ----
  470.   #!/usr/local/bin/perl
  471.   # fixpsditps: fix psdit output for use in psutils
  472.   
  473. + # feed this into perl
  474. + eval 'exec perl -S $0 "$@"'
  475. +    if $running_under_some_shell;
  476.   while (<>) {
  477.      if (/^\/p{pop showpage pagesave restore \/pagesave save def}def$/) {
  478.         print STDOUT "/p{pop showpage pagesave restore}def\n";
  479. diff -c -r +new-file psutils-dist/fixpspps psutils/fixpspps
  480. *** psutils-dist/fixpspps    Mon Feb  8 11:33:42 1993
  481. --- psutils/fixpspps    Wed Feb 10 14:38:35 1993
  482. ***************
  483. *** 1,6 ****
  484. --- 1,10 ----
  485.   #!/usr/local/bin/perl
  486.   # mangle PostScript produced by PSPrint to make it almost conforming
  487.   
  488. + # feed this into perl
  489. + eval 'exec perl -S $0 "$@"'
  490. +    if $running_under_some_shell;
  491.   $header = 1; $ignore = 0;
  492.   $verbose = 0;
  493.   @body = ();
  494. diff -c -r +new-file psutils-dist/fixwfwps psutils/fixwfwps
  495. *** psutils-dist/fixwfwps    Mon Feb  8 11:33:43 1993
  496. --- psutils/fixwfwps    Wed Feb 10 14:38:45 1993
  497. ***************
  498. *** 1,6 ****
  499. --- 1,10 ----
  500.   #!/usr/local/bin/perl
  501.   # fixwfwps: fix Word for windows PostScript for printing.
  502.   
  503. + # feed this into perl
  504. + eval 'exec perl -S $0 "$@"'
  505. +    if $running_under_some_shell;
  506.   while (<>) {
  507.      tr/\000-\011\013-\037//d;
  508.      if (/^(%!PS-Adobe-[0-9]*\.[0-9]*) EPSF-/) {
  509. diff -c -r +new-file psutils-dist/fixwpps psutils/fixwpps
  510. *** psutils-dist/fixwpps    Mon Feb  8 11:33:26 1993
  511. --- psutils/fixwpps    Wed Feb 10 14:38:53 1993
  512. ***************
  513. *** 1,6 ****
  514. --- 1,10 ----
  515.   #!/usr/local/bin/perl
  516.   # fixwpps: get semi-conforming PostScript out of WordPerfect 5.0 file
  517.   
  518. + # feed this into perl
  519. + eval 'exec perl -S $0 "$@"'
  520. +    if $running_under_some_shell;
  521.   $page = 1;
  522.   while (<>) {
  523.      s/(_[a-zA-Z]+)([0-9]+)/\1 \2/g;
  524. diff -c -r +new-file psutils-dist/patchlevel.h psutils/patchlevel.h
  525. *** psutils-dist/patchlevel.h    Mon Feb  8 11:33:44 1993
  526. --- psutils/patchlevel.h    Wed Feb 10 12:47:18 1993
  527. ***************
  528. *** 1,2 ****
  529.   #define RELEASE 1
  530. ! #define PATCHLEVEL 7
  531. --- 1,2 ----
  532.   #define RELEASE 1
  533. ! #define PATCHLEVEL 8
  534. diff -c -r +new-file psutils-dist/psnup.sh psutils/psnup.sh
  535. *** psutils-dist/psnup.sh
  536. --- psutils/psnup.sh    Wed Feb 10 14:14:49 1993
  537. ***************
  538. *** 0 ****
  539. --- 1,93 ----
  540. + #!/bin/sh
  541. + # psnup: put multiple pages onto one physical sheet of paper.
  542. + # usage:
  543. + #       psnup [-w<dim>] [-h<dim>] [-ppaper] [-l] [-2|-4|-8|-9] [file...]
  544. + #               -w<dim> sets the paper width
  545. + #               -h<dim> sets the paper height
  546. + #               -ppaper sets the paper size (width and height) by name
  547. + #               -l      is used if the pages are in landscape orientation
  548. + io= landscape=0 nup=1 width= height= paper=@PAPER@
  549. + while test $# != 0
  550. + do      case "$1" in
  551. +         -w*)    width=$1 ; paper= ;;
  552. +         -h*)    height=$1 ; paper= ;;
  553. +         -p*)    paper=`echo "$1" | sed "s/^-.//"` ;;
  554. +         -m*)    margins=`echo "$1" | sed "s/^-.//"` ;; # not implemented yet
  555. +         -l)     landscape=1 ;;
  556. +         -2)     nup=2 ;;
  557. +         -4)     nup=4 ;;
  558. +         -8)     nup=8 ;;
  559. +         -9)     nup=9 ;;
  560. +         -s*)    xscale=`echo "$1" | sed "s/^-./@/"` ;;
  561. +         -v)     echo "psnup release @RELEASE@ patchlevel @PATCHLEVEL@" ; exit 1 ;;
  562. +         *)      io="$io $1"
  563. +         esac
  564. +         shift
  565. + done
  566. + tscale=@.707     # scale for twoup
  567. + fscale=@.5       # scale for fourup
  568. + escale=@.3536    # scale for eightup
  569. + nscale=@.333     # scale for nineup
  570. + case "$paper" in
  571. + a3|A3)  width=-w29.7cm height=-h42cm ;;
  572. + a4|A4)  width=-w21cm height=-h29.7cm ;;
  573. + a5|A5)  width=-w14.85cm height=-h21cm ;;
  574. + letter) width=-w8.5in height=-h11in tscale=@.648 escale=@.324 ;;
  575. + esac
  576. + scale= offset=
  577. + case "$nup" in
  578. + 2)      scale=$tscale
  579. +         if [ $landscape = 0 ]
  580. +         then offset="(1w,0) (1w,.5h)"
  581. +         else offset="(0,.5h) (0,0)"
  582. +         fi
  583. +         landscape=`expr 1 - $landscape` ;;
  584. + 4)      scale=$fscale
  585. +         if [ $landscape = 0 ]
  586. +         then offset="(0,.5h) (.5w,.5h) (0,0) (.5w,0)"
  587. +         else offset="(.5w,0) (.5w,.5h) (1w,0) (1w,.5h)"
  588. +         fi ;;
  589. + 8)      scale=$escale
  590. +         if [ $landscape = 0 ]
  591. +         then offset="(.5w,0) (.5w,.25h) (.5w,.5h) (.5w,.75h)\
  592. +                      (1w,0) (1w,.25h) (1w,.5h) (1w,.75h)"
  593. +         else offset="(0,.75h) (.5w,.75h) (0,.5h) (.5w,.5h)\
  594. +                      (0,.25h) (.5w,.25h) (0,0) (.5w,0)"
  595. +         fi
  596. +         landscape=`expr 1 - $landscape` ;;
  597. + 9)      scale=$nscale
  598. +         if [ $landscape = 0 ]
  599. +         then offset="(0,.666h) (.333w,.666h) (.666w,.666h)\
  600. +                      (0,.333h) (.333w,.333h) (.666w,.333h)\
  601. +                      (0,0) (.333w,0) (.666w,0)"
  602. +         else offset="(.333w,0) (.333w,.333h) (.333w,.666h)\
  603. +                      (.666w,0) (.666w,.333h) (.666w,.666h)\
  604. +                      (1w,0) (1w,.333h) (1w,.666h)"
  605. +         fi ;;
  606. + esac
  607. + if [ "X$xscale" != "X" ]
  608. + then scale=$xscale
  609. + fi
  610. + if [ $landscape = 0 ]
  611. + then rotate=
  612. + else rotate=L
  613. + fi
  614. + options= sep= page=0
  615. + set ""${offset}
  616. + while [ $page -lt $nup ]
  617. + do      options="$options${sep}$page$rotate$scale$1"
  618. +         sep=+
  619. +         page=`expr $page + 1`
  620. +         shift
  621. + done
  622. + pstops $width $height "$nup:$options" $io
  623.  
  624.