|
Re: Writing a plot in PDF format from IDL [message #43545 is a reply to message #43448] |
Fri, 15 April 2005 06:07   |
btt
Messages: 345 Registered: December 2000
|
Senior Member |
|
|
Kenneth P. Bowman wrote:
> In article <1113523376.120343.69050@l41g2000cwc.googlegroups.com>,
> "kirkland" <aaamblard@yahoo.fr> wrote:
>
>
>> Does someone know how (if it is possible) to write a plot in
>> PDF format from IDL ?
>>
>
>
> Write Postscript and then use one of many methods to convert to PDF
> (Adobe Distiller, pstopdf, Illustrator, ...). Under Mac OS X, just
> double-click the PS file.
>
Under MacOSX I use the following.
;+
; NAME:
; PStoPDF
;
; PURPOSE:
; Use this procedure to convert a PostScript file to a PDF file.
;
; CALLING SEQUENCE:
; PStoPDF, filename, [/DELETEPS], [STATUS = variable], [/VERBOSE]
;
; ARGUMENTS:
; FILENAME A scalar or an array of file names for the postscript
; files to convert.
;
; KEYWORDS:
; DELETEPS Set this keyword to delete the PS file after
; converting to PDF.
; STATUS Set this keyword to a named variable to retrieve
; the operation status.It returns 1 if successful and 0 if not.
; VERBOSE Set this keyword to output update messages
; to the command line.
;
; REQUIREMENTS
; The routine spawns a command to 'pstopdf' - this is built
; in with Mac OSX and perhaps other platforms. FILE_DELETE
; is used to delete the file. FILE_DELETE appeared with IDL 5.4.
;
; MODIFICATION HISTORY
; 2004 written BT.
;-
PRO PStoPDF, psFile, $
DELETEPS = deletePS, $
STATUS = status, $
VERBOSE = verbose, $
_Ref_Extra = extra
STATUS = 0
n = n_elements(psFile)
if n EQ 0 then Return
For i = 0, n-1 Do Begin
cmd = 'pstopdf ' + psFile[i]
SPAWN,cmd, _extra = extra
If Keyword_set(DeletePS) then $
FILE_DELETE, psFile[i], _Extra = extra
if Keyword_Set(VERBOSE) then $
print, 'converting ', psFile[i] , ' to PDF'
EndFor
Status = 1
END
|
|
|
|