[comp.windows.news] Color PostScript screendump for NeWS

krempel@cmx.npac.syr.edu (Henry BJ Krempel) (09/15/88)

Is there a way to get a screendump in NeWS that is PostScript?
This seems like it ought to be easy to do (theoretically).
I already know of ways to get the pixels out and then convert them
to PostScript,  but it would be quicker to send the PostScript
directly.

Also,  is there a way to get a screendump of everything on the
Screen (the SunView windows too,  if any)?

Has anyone written a drawing editor for NeWS that saves in PostScript?
The M*cPaint program I got off the net seems to save in bitmap format.-- 
Henry B. J. Krempel	<krempel@pacrat.npac.syr.edu>
Northeast Parallel Architectures Center (NPAC)
Syracuse University
250 Machinery Hall, Syracuse,  N.Y. 13244

Sandeep Mehta@bebop (Sandeep Mehta) (09/16/88)

In article <620@cmx.npac.syr.edu>, krempel@cmx (Henry BJ Krempel) writes:
>
>Is there a way to get a screendump in NeWS that is PostScript?
>This seems like it ought to be easy to do (theoretically).

The old screendump command works in NeWs. to convert Sun raster format
to PostScript use any of the public domain programs like sun2ps or psraster.
Since I use the LaserWriter all the time my dump alias is:

alias scdump 'screendump | psraster | lpr'

I have not tried dumping both SunView and NeWS windows together, but I should
think that it would work too.

sandeep
--
Sandeep Mehta                                       uunet!philabs!bebop!sxm
Philips Laboratories                                sxm@philabs.philips.com

dwf%hope@LANL.GOV (Forslund) (09/16/88)

The surfmodl and gnuplot programs on tumtum.cs.umd.edu have example
code which dumps the window to a postscript printer.

David Forslund
MS E531
Los Alamos National Laboratory
Los Alamos, NM 87545

(505) 665-1907
(dwf@lanl.gov)

scout@campfire.Sun.COM (David LaVallee) (09/21/88)

Here's a little cut and paste and sketch program that uses the file
/tmp/clip as its storage. NeWS stores the "clip" as a run-length
encoded sun raster file (B+W or Color).

I have used this program to clip stuff for B+W and color raster
printers, on a Sun with TRANSCRIPT software this is one way to
print the rasterfile to a LaserWriter:

/usr/lib/rasfilters/convert.2 /tmp/clip | pssun | lpr

--Scoutly

%%NeWS1.1
%%author:	David A. LaVallee
%%title:	paint2

[/x0 /y0 /x1 /y1 /x /y /win /can] {null def} forall
/win framebuffer /new DefaultWindow send def
/reshapefromuser win send
{   /ClientMenu [
        (cut)
    {
        framebuffer createoverlay setcanvas getwholerect waitprocess aload pop
        framebuffer setcanvas points2rect rectpath (/tmp/clip) writescreen
    }
        (paste)
    {
        can createoverlay setcanvas getwholerect waitprocess aload pop
        can setcanvas points2rect gsave 4 2 roll translate scale
        {(/tmp/clip) readcanvas imagecanvas} stopped {pop} if grestore
    }
    ] /new DefaultMenu send def
} win send
/map win send
/can win /ClientCanvas get def
can /Retained true put

/paintit {0 setgray x1 y1 moveto x y lineto stroke} def

/setxy {
	/x1 x store /y1 y store
	begin /x XLocation store /y YLocation store end
} def

/paintbrush {
10 dict begin
    currentcursorlocation /y exch store /x exch store
    /x0 x store /y0 y store
    /x1 x store /y1 y store
    paintit
    [   null {currentprocess killprocess} /UpTransition null eventmgrinterest
	MouseDragged {setxy paintit} null null eventmgrinterest
    ] forkeventmgr pop
end
} def

/PaintEventMgr [
        PointButton {
                can setcanvas paintbrush
        } /DownTransition can eventmgrinterest
] forkeventmgr def