Re: st: Printing graphs to pdf under program control

 From Gary Longton To statalist@hsphsun2.harvard.edu Subject Re: st: Printing graphs to pdf under program control Date Wed, 13 Oct 2004 16:48:42 -0700

Ian Watson wrote:

  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.  . . .



   . . .  Finally, not all of the print graphic controls from the dialogue box
(Graphic Preferences - Printer) appear to be available in syntax, or
have I overlooked something? In particular, I notice missing are the
color mapping options, and the scaling options.

Any advice on these matters would be greatly appreciated.

Ian,

An approach which uses Distiller, rather than the 3rd party eps converter that Philippe suggests, involves setting the "watched folders" in Distiller (settings menu). \in and \out subdirectories of this directory will be created. -Graph export- to the \in subdirectory in ps format, i.e.

.graph export <watched folder path>\in\<filename>.ps, ps_options

The ps file will be automatically converted to pdf and placed in the \out subdirectory of your "watched folder".

Included among the -graph export- ps options is the scale (-mag()-) option you are looking for, along with page size, margin size, orientation, etc.

Though I've often used -graph export- (to ps) and Distiller to generate pdf files, I have to admit that I've not used the "watched folders" setting in the past to do this (did not really know it was possible until recently). Interactive conversion of multiple ps files to pdf is otherwise an easy 3-click procedure with Distiller when it is set as the default app for opening ps files, and just a couple of clicks more when not.

- Gary

*
* 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/