comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: printing to postscript with PV_WAVE
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: printing to postscript with PV_WAVE [message #853] Thu, 08 April 1993 14:26 Go to next message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
laa@lanl.gov (Lee Ankeny) writes:

> In article <1993Mar31.172224.21830@acuson.com>, worth@acuson.com (Douglas
> Worth) wrote:
>>
>> Does anyone know of an easy way to print the plot that you have
>> on your X-display? I know how to plot to Postscript, but my real
>> problem is those times when you work on adding little things to
>> plots and then want a hard copy and there is no way to just
>> zap what is already on the screen. Any help would be appreciated.
>>

> A couple of responses followed this posting. Here's my two bits:

> Bill Thompson suggested using TVRD to read the image off the Wave-generated
> X-Window, and then plotting the image to a Postscript file. Unfortunately,
> this closes the X server connection, and any other Wave windows with it.

Funny, this doesn't happen in IDL, not even when called from inside a widget.

For the record, this is the method I use in IDL.

IMAGE = TVRD(0,0,!D.X_SIZE,!D.Y_SIZE) ;Read window into an array
TVLCT, RED, GREEN, BLUE, /GET ;Get current color tables
SET_PLOT, 'PS' ;Use PostScript device
TVLCT, RED, GREEN, BLUE ;Load color tables
TV, IMAGE ;Display image of window
SET_PLOT, 'X' ;Go back to X-windows

Note: Because most color printers seem to cut off the top and bottom portions
of the page, I usually use the following DEVICE statement for landscape
orientation.

DEVICE, /LANDSCAPE, /COLOR, /INCHES, YOFFSET=9.75, XSIZE=8.5, $
BITS_PER_PIXEL=8, FILENAME=...

Bill Thompson
Re: printing to postscript with PV_WAVE [message #858 is a reply to message #853] Thu, 08 April 1993 09:44 Go to previous messageGo to next message
laa is currently offline  laa
Messages: 3
Registered: August 1992
Junior Member
In article <1993Mar31.172224.21830@acuson.com>, worth@acuson.com (Douglas
Worth) wrote:
>
> Does anyone know of an easy way to print the plot that you have
> on your X-display? I know how to plot to Postscript, but my real
> problem is those times when you work on adding little things to
> plots and then want a hard copy and there is no way to just
> zap what is already on the screen. Any help would be appreciated.
>

A couple of responses followed this posting. Here's my two bits:

Bill Thompson suggested using TVRD to read the image off the Wave-generated
X-Window, and then plotting the image to a Postscript file. Unfortunately,
this closes the X server connection, and any other Wave windows with it.

Rolf Diehl suggested using xwd, xpr and lp. This is a more general
approach, and has the advantage of being able to dump non-Wave windows as
well. Unfortunately, xpr is limited to at best a 4x4 dither representation
of color to a monochrome printer. It won't deal with color PS printers.
Also, I have been unable to render large windows, either by spreading them
across printed pages (-split n), or by scaling them (-scale n).

I've been looking at other alternatives, too. I've considered a variant of
Bill's method which would use DC_WRITE_TIFF instead of switching to
postscript. Then the tiff-printer (perhaps from Sam Loeffer's stuff?) could
be spawned. Again, this would require some contortions to print a non-Wave
window.

I guess the ideal solution would be to find a xwd-format to
PostScript-format converter. This would be similar to Rolf's solution, but
would avoid the weaknesses of xpr.

Does anyone know of such a utility?

------------------------------------------------------------ ------
Lee Ankeny
Los Alamos National Laboratory
laa@lanl.gov
Re: printing to postscript with PV_WAVE [message #883 is a reply to message #858] Fri, 02 April 1993 10:54 Go to previous messageGo to next message
dieh2133 is currently offline  dieh2133
Messages: 11
Registered: December 1992
Junior Member
I am not sure whether all implementations of X have xpr and xwd (utilities to
dump and print X-windows.) but if You have it You might try something like
the following procedure which I use to dump a window on my hp9k345 to my hp-paintjet.
If You change the options for xpr and lp that should work for any printer.

; TUB, Rolf Diehl; Tue Dec 17 21:20:39 MEZ 1991

pro xwd,nu

;dump window to the paintjet
;
;nu number or the WAVE window
;------------------------------------------
windowname=''
case n_params() of
0:begin
print,'Enter name of window to dump? '
read,windowname
end
1: windowname='WAVE '+strtrim(string(nu),2)
endcase

spawn,"xwd -name '"+windowname+"' | xpr -device pjet | lp -dpaint -oraw -onb "
end

--
Mit freundlichen Gruessen
Rolf Diehl.

____________________________________________________________ _________
|Dipl.-Ing. Rolf Diehl, TU Berlin, Institut fuer technische Akustik |
|Tel 030-314-22889, Fax -23222, dieh2133@files1zrz.zrz.tu-berlin.de |
|___________________________________________________________ ________|
Re: printing to postscript with PV_WAVE [message #887 is a reply to message #883] Thu, 01 April 1993 07:04 Go to previous messageGo to next message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
worth@acuson.com (Douglas Worth) writes:

> Does anyone know of an easy way to print the plot that you have
> on your X-display? I know how to plot to Postscript, but my real
> problem is those times when you work on adding little things to
> plots and then want a hard copy and there is no way to just
> zap what is already on the screen. Any help would be appreciated.

The following will do the trick.

IMAGE = TVRD(0,0,!D.X_SIZE,!D.Y_SIZE) ;Read window as image
TVLCT,RED,GREEN,BLUE,/GET ;Get color table
SET_PLOT,'PS' ;Select PostScript
;
; Most color PostScript printers don't seem to able to plot all the way to the
; edge. Therefore, I make the area available for use by IDL somewhat smaller
; in the long dimension of the paper. The following shows the settings I use
; for landscape and portrait modes.
;
DEVICE, /LANDSCAPE, /COLOR, /INCHES, YOFFSET=9.75, XSIZE=8.5, BITS_PER_PIXEL=8
;
; or
;
;DEVICE, /PORTRAIT, /COLOR, /INCHES, XOFFSET=0.75, YOFFSET=1.25, $
; XSIZE=7.0, YSIZE=8.5, BITS_PER_PIXEL=8
;
TVLCT,RED,GREEN,BLUE ;Load color table
TV,IMAGE ;Display image of window
SET_PLOT,'X' ;Return to X-windows

You might want to play with the offset and size parameters to suit yourself.

Bill Thompson
Re: printing to postscript with PV_WAVE [message #991 is a reply to message #858] Wed, 14 April 1993 10:20 Go to previous message
dieh2133 is currently offline  dieh2133
Messages: 11
Registered: December 1992
Junior Member
In article <laa-080493100153@berserk.c3.lanl.govL>, laa@lanl.gov (Lee Ankeny) writes:
|>
|> I guess the ideal solution would be to find a xwd-format to
|> PostScript-format converter. This would be similar to Rolf's solution, but
|> would avoid the weaknesses of xpr.
|>
|> Does anyone know of such a utility?
|>
Th pbm-package (portable-bitmap) includes a xbmtopbm converter, but I do not know
about a converter from pbm to postscript, but there are several other
converters for printers which might as well do the trick.
--
Mit freundlichen Gruessen
Rolf Diehl.

____________________________________________________________ _________
|Dipl.-Ing. Rolf Diehl, TU Berlin, Institut fuer technische Akustik |
|Tel 030-314-22889, Fax -23222, dieh2133@files1zrz.zrz.tu-berlin.de |
|___________________________________________________________ ________|
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IMSL/IDL encapsulated postscript; DVIPS translation
Next Topic: IDL widget_label questions

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:49:06 PDT 2025

Total time taken to generate the page: 0.11712 seconds