Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: graphs in pdf format


From   Lars Korsholm <korsholm@isd.sdu.dk>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: graphs in pdf format
Date   Wed, 9 Apr 2003 13:57:04 +0200 (MEST)



On Wed, 9 Apr 2003, Philippe Glaziou wrote:

> Lars Korsholm <korsholm@isd.sdu.dk> wrote:
> > will exporting graphs in pdf format be available on other
> > platforms as well?  
> > I use unix and linux 
> > We realy miss it
> 
> Then a pdf graph will be produced using:
> 
> . graph export foo.ps
> . !ps2pdf foo.ps
> 

and Alan Riley from stat corp wrote something like this.
I was looking for a direct way.

I have written a small wrapper program, see below.

best lars

######### ado file ###########

*! Lars Korsholm: 09april2003 
program define exportpdf
	version 8.0 
        syntax namelist(min=1 max=1) [, REmove  *]
        local file `"`namelist'.eps"'
        graph export `file', `options'
        ! epstopdf `file'
        if "`remove'"!="" {
           ! rm `file'
        }
end 
exit

#### help file ########

.-
help for  ^exportpdf^ 
.-

Exporting graphs in pdf format on unix/linux systems
----------------------------------------------------

     ^exportpdf^ filename [, remove options ]
                           

Description
-----------

     ^exportpdf^ is a wrapper for ^graph export filename.eps^ 
     and a system call of ^epstopdf^.
     The ^filname^ should be given without ^.pdf^ extension.
     As a by-prodict an ^filename.eps^ file is produced.
     
Options
-------

^remove^ specifie that the eps file should be remove from the file system.
   
^options^ are any options that goes with @graph export@



Examples
--------

   . ^suysuse auto^
   . ^scatter mpg weight^
   . ^exportpdf test^
   . ^exportpdf test2, replace^

Author
------

     Lars Korsholm
     Dept of Statistics
     University of Sourthern Denmark
     korsholm@isd.sdu.dk


Also See
--------

    On-line: help on @graph export@

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index