Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: copying graphs in Mac


From   [email protected]
To   [email protected]
Subject   Re: st: copying graphs in Mac
Date   Mon, 12 Jan 2009 13:43:27 -0600

David Airey <[email protected]> wrote:

> For the record, Stata 10 for OS X copies graphs to the Finder  
> clipboard as PDF. For some applications this doesn't paste at all, and  
> that behavior is not satisfying I agree. For example, pasting works  
> fine into Apple Pages and Microsoft Word, but Apple Mail does not  
> recognize the clipboard contents. Apple Mail will paste if you choose  
> Paste and Match Style or Past as Quotation rather than plain Paste.  
> The Apple Finder clipboard also doesn't recognize what is on the  
> clipboard after copying a graph from Stata, if you Show clipboard in  
> the Finder. Remember you can change what goes onto the clipboard in  
> the Stata general preferences such that is PICT. If you do that, you  
> can past anywhere, but then you get PICT not the better PDF. Also, the  
> Finder clipboard does recognize what is on the clipboard if you copy  
> as PICT (it says and shows a picture). All this seems a little buggy  
> to me, either in the Finder or in Stata for Mac. I think it is Stata,  
> because if you have a PDF open in Preview, and you copy, you get a  
> picture in the Finder clipboard no problem.

Apple has been encouraging developers to switch to the PDF format for
Clipboard data for some time yet they have been inconsistent in how they treat
data from the Clipboard.  The Clipboard viewer, for some reason, still cannot
display PDF data.  The reason you see an image in the Clipboard when you copy
a PDF from Preview is that Preview copied the PDF data, a TIFF representation
of the PDF data, and PICT data to the Clipboard.  I can't explain why Mail
does not simply paste the PDF data from the Clipboard.  It seems like a
strange oversight to me since it's very simple for Cocoa applications to
convert PDF to TIFF.

Stata currently copies either PDF data or PICT to the Clipboard.  In a
future update, Stata will copy both PDF data and PICT data to the Clipboard.
This will allow applications that still don't support pasting PDF data to at
least paste in PICT data.  For technical reasons, a TIFF representation
won't be included.

While investigating a user's issues with importing Stata graphs, I observed
a few shortcomings in importing vector graphics in general into OpenOffice.
The short version is that it can't import PDF, converts PICT to bitmap
(inconsistently at that), and can't display or print EPS files that don't
contain a TIFF preview.  The reason I say OpenOffice is inconsistent with
importing PICT is that I got different results when pasting in a PICT image
and inserting a PICT file of the same image.

I also looked at NeoOffice but it has it's share of shortcomings too.  It will
import PDF data but it too converts the vector graphics to bitmap graphics,
then scales the image to fit the page.  This can cause the image to look
really blurry.  However, it will display and print an imported EPS file
regardless of whether it includes a TIFF preview or not.

This is not an official endorsement of NeoOffice by me or StataCorp but my
initial observation is that for the best output of Stata graphs, I recommend
you use NeoOffice and import Stata graphs exported as EPS files.  I definitely
don't recommend using copy/paste if you want to print graphs from NeoOffice or
OpenOffice.

Unfortunately, Microsoft Office will not open a document saved by NeoOffice
that has an embedded EPS file.  If the goal is to create a document containing
a Stata graph using either OpenOffice or NeoOffice and is compatible with
Microsoft Office, then I suggest using NeoOffice and importing a bitmap (by
pasting from the Clipboard or inserting an image on disk).

PS.  Microsoft Office 2008 for the Mac supports pasting PDF data from the
Clipboard.  However, it converts all rotated text to horizontal text.

PS2. To get around the blurry scaling issue when pasting a graph from Stata to
NeoOffice, increase the xsize and ysize of your Graph.  When converting a
Stata graph in the PDF format to bitmap, NeoOffice converts the image size
from inches (Stata's graphs default to 5.5in x 4in) to pixels using the
conversion metric of 72 dots-per-inch (DPI).  To get twice as much pixel
resolution, you would use an xsize of 11 and ysize of 8.  If the image is too
wide, NeoOffice will scale it down which is OK.  The goal is to make the image
larger so that NeoOffice doesn't have to scale up.

-Chinh Nguyen
 [email protected]

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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