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

Home » Public Forums » archive » Re: Writing a plot in PDF format from IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Writing a plot in PDF format from IDL [message #43545 is a reply to message #43448] Fri, 15 April 2005 06:07 Go to previous messageGo to previous message
btt is currently offline  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
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: why do not the results agree?
Next Topic: Re: Inverse CWT

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

Current Time: Sat Oct 11 10:09:32 PDT 2025

Total time taken to generate the page: 0.48349 seconds