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

Re: st: Printing graphs to pdf under program control


From   [email protected] (Alan Riley)
To   [email protected]
Subject   Re: st: Printing graphs to pdf under program control
Date   Sat, 16 Oct 2004 14:50:39 -0500

Ian Watson ([email protected]) asked about automating the
production of PDF copies of Stata graphs:
> Has anyone had success passing a filename under program control to
> Acrobat Distiller on a Windows platform?
>
> I wish to print my graph to a pdf file, but graph export (to pdf) is
> not available under Windows. I can of course print to Acrobat
> Distiller manually. But what I want to do is automate the procedure
> inside a do file. ...

This should be possible by using Distiller's command-line parameters.
I just tried the following on my system from within Stata:

  . sysuse auto
  . scatter mpg weight
  . graph export c:\temp\mytest.eps
  . !"C:\Program Files\Adobe\Acrobat 5.0\Distillr\acrodist.exe"
       /o c:\temp\mytest.pdf c:\temp\mytest.eps
  
Note that everything after the shell command (!) should all be on
one line.

This fired up an instance of Distiller and converted the file
c:\temp\mytest.eps which came from Stata into a pdf file.  The
following document on Adobe's site may be of some additional
assistance:

   http://www.adobe.com/support/techdocs/321090.html

It appears that a "job options file" may be created for Distiller
to allow you to control various settings for the conversion process
such as what font substitutions to use.  I did not find it necessary
to do this in my test case above, however.


--Alan
([email protected])
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index