--- ray/src/px/ra_ps.c 1992/07/13 09:53:14 2.2 +++ ray/src/px/ra_ps.c 1992/08/14 13:27:52 2.4 @@ -24,6 +24,7 @@ int wrongformat = 0; /* input in wrong format? */ double pixaspect = 1.0; /* pixel aspect ratio */ int bradj = 0; /* brightness adjustment */ +int ncopies = 1; /* number of copies */ char *progname; @@ -59,6 +60,9 @@ char *argv[]; goto userr; bradj = atoi(argv[++i]); break; + case 'n': /* number of copies */ + ncopies = atoi(argv[++i]); + break; default: goto userr; } @@ -115,7 +119,7 @@ char *name; printf("%%!\n"); printf("%%%%Title: %s\n", name); printf("%%%%Creator: %s\n", progname); - printf("%%%%Pages: 1\n"); + printf("%%%%Pages: %d\n", ncopies); if (landscape = xmax > pixaspect*ymax) printf("%%%%Landscape\n"); else @@ -123,6 +127,8 @@ char *name; printf("%%%%EndComments\n"); printf("gsave\n"); printf("64 dict begin\n"); + /* define image reader */ + PSprocdef("read6bit"); /* set up transformation matrix */ printf("%f %f translate\n", HMARGIN, VMARGIN); if (PWIDTH > PHEIGHT ^ landscape) { @@ -143,8 +149,8 @@ char *name; } printf("%f %f translate\n", (pwidth-iwidth)*.5, (pheight-iheight)*.5); printf("%f %f scale\n", iwidth, iheight); - PSprocdef("read6bit"); printf("%%%%EndProlog\n"); + /* start image procedure */ printf("%d %d 8 [%d 0 0 %d 0 %d] {read6bit} image", xmax, ymax, xmax, -ymax, ymax); } @@ -153,9 +159,10 @@ char *name; PStrailer() /* print PostScript trailer */ { puts("%%Trailer"); - puts("end"); + if (ncopies > 1) + printf("/#copies %d def\n", ncopies); puts("showpage"); - puts("grestore"); + puts("end"); puts("%%EOF"); }