Postscript for different paper sizes [message #5618] |
Fri, 19 January 1996 00:00  |
f055
Messages: 29 Registered: April 1995
|
Junior Member |
|
|
When outputting plots to the PS device, does the PS file contain any
settings for the paper size? If so, what is the default? Letter?
If so, how can I change it to A4 or A3 etc.?
Cheers,
Tim
......................... Dr Tim Osborn . t.osborn@uea.ac.uk
.... ___/.. __ /.. /.. /. Senior Research Associate . phone:01603 592089
... /..... /. /.. /.. /.. Climatic Research Unit . fax: 01603 507784
.. /..... __/.. /.. /... School of Environmental Sciences.
. /..... /\ ... /.. /.... University of East Anglia .
____/.._/..\_..____/..... Norwich NR4 7TJ .
......................... UK .
|
|
|
Re: Postscript for different paper sizes [message #5686 is a reply to message #5618] |
Wed, 24 January 1996 00:00  |
hahn
Messages: 108 Registered: November 1993
|
Senior Member |
|
|
pit@asterix.kis.uni-freiburg.de (Peter Suetterlin) wrote:
> In article <4do2gb$s94@cpca3.uea.ac.uk>,
> f055@uea.ac.uk (T.Osborn) writes:
>>
>> When outputting plots to the PS device, does the PS file contain any
>> settings for the paper size?
There is no way to set a paper size in PostScript. You can request a
specific paper size and you can query the size of the print area when
the printer is directly attached to the computer. The application
program (IDL in this case) is responsible for generating the
necessary instructions to fit the plot onto the page. A PostScript
printer is not allowed to scale or rotate the page on its own to
make it fit! This is left to the device driver.
>> If so, what is the default? Letter?
Here is what is contained in IDL Help:
Feature Value
File idl.ps
Mode Portrait, non-encapsulated, no color
Horizontal offset 3/4 in.
Vertical offset 5 in.
Width 7 in.
Height 5 in.
Scale factor 1.0
Font size 12 points
Font Helvetica
# Bits / Image Pixel 4
Table 3.12 Default PostScript Driver Settings
>> If so, how can I change it to A4 or A3 etc.?
> I'm not shure whether special procedures for this exist, but you can
> always set the dimensions you like using the device procedure:
> set_plot,'ps'
> device, xsize=28,ysize=41,xoffset=0.8,yoffset=0.5
> would give you about an A3 Plotting range.
Hmmm well, it may work, but...
Older versions of IDL contained a procedure called
phaser.pro to correctly setup for a Tektronix Phaser
printer. Acutally you have a lot of parameters to
define, esp. when you want to generate both portrait
and landscape output.
I adapted the old Phaser.pro for our Tek Phaser IIIpxi
which can handle both A3 and A4 and the similar US
formats. The essence of my phaser3.pro is:
; $Id: phaser.pro,v 1.2 1993/04/02 19:43:31 Ha THD $
pro phaser3, medium=medium, landscape=landscape, portrait=portrait, $
filename=filename
[comments deleted to save bandwidth]
; MODIFICATION HISTORY:
; Created 22-OCT-1991 by Mark Rivers.
; Adapted 22-Nov-1993 by Norbert Hahn, THD.
; Update 14OCTv-1994 by Norbert Hahn, THD: /isolatin1 added
;-
short_side = 28.55
small_offset=(29.7-short_side)/2.0
long_side = 40.75
big_offset=(42.0-long_side)/2.0
if n_elements(medium) ne 0 then begin
c_size = STRUPCASE(STRCOMPRESS(medium,/REMOVE_ALL))
endif else begin
c_size = 'A3P'
endelse
if n_elements(filename) ne 0 then begin
fn = filename
endif else begin
fn = 'idl.ps'
endelse
set_plot, 'ps'
if c_size eq 'A4P' then begin
short_side = 19.76
small_offset=(21.0-short_side)/2.0
long_side = 28.58
big_offset=(29.7-long_side)/2.0
endif
if c_size eq 'A4F' then begin
short_side = 20.0
small_offset=(21.0-short_side)/2.0
long_side = 27.0
big_offset=(29.7-long_side)/2.0
endif
if n_elements(portrait) ne 0 then begin
device, bits=8, /color, xsize=short_side, ysize=long_side, $
xoffset=small_offset, yoffset=big_offset, $
/portrait, /isolatin1, filename=fn
endif else begin
device, bits=8, /color, xsize=long_side, ysize=short_side, $
xoffset=small_offset, yoffset=long_side+big_offset, $
/landscape, /isolatin1, filename=fn
endelse
end
> Peter
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
> Peter "Pit" Suetterlin http://www.kis.uni-freiburg.de/~ps
> Kiepenheuer Institut fuer Sonnenphysik
> Tel.: +49 761 3198-210 ps@kis.uni-freiburg.de
> -- * -- * ...-- * -- * ...-- * -- * ...-- * -- * ...-- * -- * ...-- * --
> Come and see the stars! http://www.kis.uni-freiburg.de/~ps/SFB
> Sternfreunde Breisgau e.V.
> Tel.: +49 761 73571 or 278588
> ____________________________________________________________ ______________
Norbert Hahn
University of Darmstadt
Germany
|
|
|
Re: Postscript for different paper sizes [message #5690 is a reply to message #5618] |
Wed, 24 January 1996 00:00  |
zawodny
Messages: 121 Registered: August 1992
|
Senior Member |
|
|
In article <4e5c13$5la@n.ruf.uni-freiburg.de> pit@asterix.kis.uni-freiburg.de (Peter Suetterlin) writes:
> In article <4do2gb$s94@cpca3.uea.ac.uk>,
> f055@uea.ac.uk (T.Osborn) writes:
>>
>> When outputting plots to the PS device, does the PS file contain any
>> settings for the paper size? If so, what is the default? Letter?
>> If so, how can I change it to A4 or A3 etc.?
>
> I'm not shure whether special procedures for this exist, but you can
> always set the dimensions you like using the device procedure:
>
> set_plot,'ps'
> device, xsize=28,ysize=41,xoffset=0.8,yoffset=0.5
>
> would give you about an A3 Plotting range.
>
> Peter
I have a routine I use to switch between the different printers and paper
sizes we use here. It can be modified to handle your needs and is appended
to this message.
Good luck,
Dr. Joseph M. Zawodny KO4LW NASA Langley Research Center
E-mail: J.M.Zawodny@LaRC.NASA.gov MS-475, Hampton VA, 23681-0001
;+
; NAME:
; SET_GRAPH
; PURPOSE:
; Make setting up device dependant defaults easy
; CATEGORY:
; ?
; CALLING SEQUENCE:
; SET_GRAPH,/device_type
; INPUTS:
; KEYWORDS:
; /ps sets up for black and white postscript
; /x sets up for X windows
; /cps sets up for color postscript
; /land select the landscape option (used with /ps or /cps)
; /legal change size for 8.5"x 14" paper (used with /cps)
; /s11x17 change size for 11" x 17" paper (used with /cps)
; OUTPUTS:
; NONE.
; COMMON BLOCKS:
; NONE.
; SIDE EFFECTS:
; Changes a bunch of items that control plotting
; RESTRICTIONS:
; NONE. Modify to suit your personal desires.
; PROCEDURE:
; STRAIGHTFORWARD
; MODIFICATION HISTORY:
; May 1, 1989 J. M. Zawodny, NASA/LaRC, MS 475, Hampton VA, 23665.
; Dec 12, 1989 JMZ, Added /LEGAL, and changed setting of !n.THICK
;-
pro SET_GRAPH,dummy,ps=ps,x=x,cps=cps,land=land,legal=legal,s11x 17=s11x17
outs = ''
if keyword_set(cps) then begin
set_plot,'ps'
if keyword_set(land) then begin
xsize = 10.20 ; x size of plot area in inches
ysize = 7.65 ; y size of plot area in inches
xcen = 4.25
ycen = 5.50
if keyword_set(legal) then begin
xsize = 10.50 ; x size of plot area in inches
ysize = 8.10 ; y size of plot area in inches
xcen = 4.25
ycen = 5.50
endif
if keyword_set(s11x17) then begin
; Tested OK
xsize = 16.25 ; x size of plot area in inches
ysize = 10.50 ; y size of plot area in inches
; xcen = 5.50
; ycen = 8.50
xcen = 8.50
ycen = 5.50
outs = 'statusdict begin 11x17tray statusdict end'
endif
xoff = xcen-ysize/2. ; x offset to center the plot
yoff = ycen+xsize/2. ; y offset to center the plot
device,land=land,/bkman,/light,/color,bits=8
endif else begin
xsize = 7.65 ; x size of plot area in inches
ysize = 10.20 ; y size of plot area in inches
xcen = 4.25
ycen = 5.50
if keyword_set(legal) then begin
xsize = 8.1 ; x size of plot area in inches
ysize = 10.5 ; y size of plot area in inches
xcen = 4.25
ycen = 5.50
endif
if keyword_set(s11x17) then begin
xsize = 10.5 ; x size of plot area in inches
ysize = 16.25 ; y size of plot area in inches
xcen = 5.50
ycen = 8.50
outs = 'statusdict begin 11x17tray statusdict end'
endif
xoff = xcen-xsize/2. ; x offset to center the plot
yoff = ycen-ysize/2. ; y offset to center the plot
device,/bkman,/light,/color,bits=8
endelse
device,/helvetica,font_index=20
device,/bkman,/light,font_index=3
device,/inch,xoff=xoff,yoff=yoff,xsize=xsize,ysize=ysize
;; if(outs ne '') then device,output=outs
!p.font = 0
thick = 2
endif
if keyword_set(ps) then begin
set_plot,'ps'
if keyword_set(land) then begin
xsize = 10. ; x size of plot area in inches
ysize = 7.5 ; y size of plot area in inches
xoff = 4.25-ysize/2. ; x offset to center the plot
yoff = 5.50+xsize/2. ; y offset to center the plot
if keyword_set(s11x17) then begin
xsize = 16.25 ; x size of plot area in inches
ysize = 10.50 ; y size of plot area in inches
xcen = 5.50
ycen = 8.50
xoff = xcen-ysize/2. ; x offset to center the plot
yoff = ycen+xsize/2. ; y offset to center the plot
endif
device,land=land,/bkman,/light
endif else begin
xsize = 8.0 ; x size of plot area in inches
ysize = 10. ; y size of plot area in inches
xoff = 4.25-xsize/2. ; x offset to center the plot
yoff = 5.50-ysize/2. ; y offset to center the plot
device,/bkman,/light
if keyword_set(s11x17) then begin
xsize = 10.5 ; x size of plot area in inches
ysize = 16.25 ; y size of plot area in inches
xcen = 5.50
ycen = 8.50
xoff = xcen-xsize/2. ; x offset to center the plot
yoff = ycen-ysize/2. ; y offset to center the plot
endif
endelse
device,/helvetica,font_index=20
device,/bkman,/light,font_index=3
device,/inch,xoff=xoff,yoff=yoff,xsize=xsize,ysize=ysize
!p.font=0
thick=2
endif
if keyword_set(x) then begin
set_plot,'x'
!p.font = -1
thick = 1
endif
!p.thick = thick
!x.thick = thick
!y.thick = thick
return
end
--
Dr. Joseph M. Zawodny KO4LW NASA Langley Research Center
E-mail: J.M.Zawodny@LaRC.NASA.gov MS-475, Hampton VA, 23681-0001
|
|
|
Re: Postscript for different paper sizes [message #5691 is a reply to message #5618] |
Wed, 24 January 1996 00:00  |
pit
Messages: 92 Registered: January 1996
|
Member |
|
|
In article <4do2gb$s94@cpca3.uea.ac.uk>,
f055@uea.ac.uk (T.Osborn) writes:
>
> When outputting plots to the PS device, does the PS file contain any
> settings for the paper size? If so, what is the default? Letter?
> If so, how can I change it to A4 or A3 etc.?
I'm not shure whether special procedures for this exist, but you can
always set the dimensions you like using the device procedure:
set_plot,'ps'
device, xsize=28,ysize=41,xoffset=0.8,yoffset=0.5
would give you about an A3 Plotting range.
Peter
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
Peter "Pit" Suetterlin http://www.kis.uni-freiburg.de/~ps
Kiepenheuer Institut fuer Sonnenphysik
Tel.: +49 761 3198-210 ps@kis.uni-freiburg.de
-- * -- * ...-- * -- * ...-- * -- * ...-- * -- * ...-- * -- * ...-- * --
Come and see the stars! http://www.kis.uni-freiburg.de/~ps/SFB
Sternfreunde Breisgau e.V.
Tel.: +49 761 73571 or 278588
____________________________________________________________ ______________
|
|
|