Index: /trunk/Ohana/src/kapa/event/CheckPipe.c
===================================================================
--- /trunk/Ohana/src/kapa/event/CheckPipe.c	(revision 10801)
+++ /trunk/Ohana/src/kapa/event/CheckPipe.c	(revision 10802)
@@ -46,4 +46,10 @@
   if (!strcmp (buffer, "PSNS")) {
     status = PSit (NOSCALE);
+    write (sock, "DONE", 4);
+    return (status);
+  }
+  
+  if (!strcmp (buffer, "PSNP")) {
+    status = PSit (NEWPAGE);
     write (sock, "DONE", 4);
     return (status);
Index: /trunk/Ohana/src/kapa/graph/PSObjects.c
===================================================================
--- /trunk/Ohana/src/kapa/graph/PSObjects.c	(revision 10801)
+++ /trunk/Ohana/src/kapa/graph/PSObjects.c	(revision 10802)
@@ -20,5 +20,10 @@
   filename[status] = 0; /* make the string easy to parse */
 
-  f = fopen (filename, "w");
+  if (mode == NEWPAGE) {
+    f = fopen (filename, "a");
+  } else {
+    f = fopen (filename, "w");
+  }
+
   if (f == (FILE *) NULL) {
     fprintf (stderr, "can't open output file %s\n", filename);
@@ -34,15 +39,25 @@
   }
 
-  if (mode != RAW) {
-    fprintf (f, "%%!PS-Adobe-2.0 EPSF-2.0\n");
-    fprintf (f, "%%%%Title: Kapa Plot\n");
-    fprintf (f, "%%%%Creator: Kapa (0.95)\n");
-    fprintf (f, "%%%%BoundingBox: %d %d %.0f %.0f\n", 
-	     XOFFSET, YOFFSET, XOFFSET + scale*graphic.dx, YOFFSET + scale*graphic.dy);
-    fprintf (f, "%%%%Pages: 1\n");
-    fprintf (f, "%%%%DocumentFonts:\n");
-    fprintf (f, "%%%%EndComments\n");
-    fprintf (f, "%%%%EndProlog\n");
-    fprintf (f, "%%%%Page: 1 1\n\n");
+  switch (mode) {
+    case NEWPAGE:
+      fprintf (f, "%%%%Page: foobar\n\n");
+      break;
+
+    case SCALE:
+    case NOSCALE:
+      fprintf (f, "%%!PS-Adobe-2.0 EPSF-2.0\n");
+      fprintf (f, "%%%%Title: Kapa Plot\n");
+      fprintf (f, "%%%%Creator: Kapa (0.95)\n");
+      fprintf (f, "%%%%BoundingBox: %d %d %.0f %.0f\n", 
+	       XOFFSET, YOFFSET, XOFFSET + scale*graphic.dx, YOFFSET + scale*graphic.dy);
+      fprintf (f, "%%%%Pages: 1\n");
+      fprintf (f, "%%%%DocumentFonts:\n");
+      fprintf (f, "%%%%EndComments\n");
+      fprintf (f, "%%%%EndProlog\n");
+      fprintf (f, "%%%%Page: foobar\n\n");
+      break;
+
+    case RAW:
+      break;
   } 
   fprintf (f, "gsave %% encloses picture\n");
Index: /trunk/Ohana/src/kapa/include/constants.h
===================================================================
--- /trunk/Ohana/src/kapa/include/constants.h	(revision 10801)
+++ /trunk/Ohana/src/kapa/include/constants.h	(revision 10802)
@@ -26,5 +26,5 @@
 # define LABELLR 7
 
-enum {SCALE, NOSCALE, RAW};
+enum {SCALE, NOSCALE, RAW, NEWPAGE};
 
 /* EVENT_MASK consists of:
Index: /trunk/Ohana/src/libkapa/include/kapa.h
===================================================================
--- /trunk/Ohana/src/libkapa/include/kapa.h	(revision 10801)
+++ /trunk/Ohana/src/libkapa/include/kapa.h	(revision 10802)
@@ -110,5 +110,5 @@
 
 /* KiiConvert.c */
-int KiiPS (int fd, int scale, int raw, char *filename);
+int KiiPS (int fd, int scale, int raw, int newpage, char *filename);
 int KiiJPEG (int fd, char *filename);
 int KapaPNG (int fd, char *filename);
Index: /trunk/Ohana/src/libkapa/src/KiiConvert.c
===================================================================
--- /trunk/Ohana/src/libkapa/src/KiiConvert.c	(revision 10801)
+++ /trunk/Ohana/src/libkapa/src/KiiConvert.c	(revision 10802)
@@ -37,5 +37,5 @@
 }
 
-int KiiPS (int fd, int scale, int raw, char *filename) {
+int KiiPS (int fd, int scale, int raw, int newpage, char *filename) {
 
   char buffer[20];
@@ -49,8 +49,10 @@
     goto name;
   }
-  if (!raw && !scale) {
-    KiiSendCommand (fd, 4, "PSIT");
+  if (newpage) {
+    KiiSendCommand (fd, 4, "PSNP");
     goto name;
   }
+  /* the default operation */
+  KiiSendCommand (fd, 4, "PSIT");
 
 name:
Index: /trunk/Ohana/src/opihi/cmd.data/ps.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/ps.c	(revision 10801)
+++ /trunk/Ohana/src/opihi/cmd.data/ps.c	(revision 10802)
@@ -4,9 +4,15 @@
 
   char filename[1024];
-  int N, Source, Nsource, RawImage, NoScale, IsImage;
+  int N, Source, Nsource, RawImage, NoScale, NewPage, IsImage;
   
   if ((N = get_argument (argc, argv, "--help"))) goto help;
   if ((N = get_argument (argc, argv, "-h"))) goto help;
 
+  /* raw image? */
+  NewPage = FALSE;
+  if ((N = get_argument (argc, argv, "-newpage"))) {
+    remove_argument (N, &argc, argv);
+    NewPage = TRUE;
+  }
   /* raw image? */
   RawImage = FALSE;
@@ -54,5 +60,5 @@
   
   /* tell Ximage/Xgraph to ps the image */
-  KiiPS (Source, NoScale, RawImage, filename);
+  KiiPS (Source, NoScale, RawImage, NewPage, filename);
   return (TRUE);
 
Index: /trunk/Ohana/src/relastro/src/plotstuff.c
===================================================================
--- /trunk/Ohana/src/relastro/src/plotstuff.c	(revision 10801)
+++ /trunk/Ohana/src/relastro/src/plotstuff.c	(revision 10802)
@@ -49,5 +49,5 @@
   if (Xgraph[N] == 0) return;
 
-  KiiPS (Xgraph[N], FALSE, FALSE, filename);
+  KiiPS (Xgraph[N], FALSE, FALSE, FALSE, filename);
   return;
 }
Index: /trunk/Ohana/src/relphot/src/plotstuff.c
===================================================================
--- /trunk/Ohana/src/relphot/src/plotstuff.c	(revision 10801)
+++ /trunk/Ohana/src/relphot/src/plotstuff.c	(revision 10802)
@@ -49,5 +49,5 @@
   if (Xgraph[N] == 0) return;
 
-  KiiPS (Xgraph[N], FALSE, FALSE, filename);
+  KiiPS (Xgraph[N], FALSE, FALSE, FALSE, filename);
   return;
 }
