Re: Copy/paste selection of a pdf on Mac
- To: mathgroup at smc.vnet.net
- Subject: [mg99113] Re: Copy/paste selection of a pdf on Mac
- From: Jens <noeckel at gmail.com>
- Date: Mon, 27 Apr 2009 05:24:29 -0400 (EDT)
- References: <gt0ru4$e4l$1@smc.vnet.net>
On Apr 25, 10:37 pm, "A. B." <functionalcoati... at gmail.com> wrote: > In Apple Preview.app, Leopard (10.5), the menu View:PDf Display: has two > options, 'Media Box' and 'Crop Box'. If one selects and copies a portion of > a pdf and creates in Preview a new pdf from the clipboard, then View Crop > Box shows the selected part only while View Media Box shows the whole page. > It means that applications such as Apple Pages and Keynote (and also > TexShop) show the pasted portion of the pdf in Crop view, while Mathematica > shows the whole pasted pdf page, ie the 'Media view'. > > A.B. > > > I think this has more to do with Apple than Mathematica: > > > - Select a portion of a pdf file in Preview.app and copy to the clipboard, > > - Paste in Mathematica. > > > This results in the whole pdf page being pasted in Mathematica. Researching on > > the web showed that this same behaviour was observed with Keynote at some > > point but it has since been fixed. > > It has to do with a new so-called "non-destructive" way that Preview now uses > > for cropping. The application where the pasting is done needs to be made aware > > of this change on the part of Apple. Thus, on my 10.5.6 system, pasting works > > well with Pages and Keynote (iWork 9). > > A workaround is to paste in one of these applications, copy the pdf image and > > paste it in Mathematica. This works as expected. > > > Regards, > > A.B. Hi, the problem is that the CropBox is being ignored by Mathematica. Perhaps the easiest workaround for this issue is to replace Preview with the free PDF reader and annotation application Skim (http://skim- app.sourceforge.net/). Copying from Skim to Mathematica works fine because it puts the crop information into the MediaBox dimensions. Another possibility, if you want to keep using Preview (e.g., because it's more versatile with non-PDF formats), would be based on a script I wrote last year, precisely for this purpose in conjunction with the earlier versions of Keynote. I now slightly modified my script to change the MediaBox as required by Mathematica, and I've posted it as an AppleScript bundle in the file clipPDF-noGS-1.2.zip which can be downloaded at http://www.uoregon.edu/~noeckel/PreviewLeopard.html#nogsMediaBox You would then copy a selection in Preview as usual, but before pasting into Mathematica invoke this script from the script menu bar. It directly modifies the current PDF clipboard contents, so that only cropped part of the PDF appears when you subsequently paste into Mathematica. To install this script, just follow the instructions in the accompanying README file (there's no need for any additional downloads). Regards, Jens