[OS X TeX] Shadows of pdf in Keynote

Jens Noeckel noeckel at uoregon.edu
Sun Apr 6 17:24:32 EDT 2008

On Apr 5, 2008, at 8:52 AM, Martin Costabel wrote:

> Jens Noeckel wrote:
> []
>>>> Chris Goedde wrote:
>>>> []
>>>>> Keynote 3 is broken, though, it doesn't correctly recognize the  
>>>>> cropping of pdf's done in Preview (don't know if that's  
>>>>> different in Keynote 4).
>> reading this, I tried it out on my Leopard machine, with Keynote 3  
>> (I have Keynote 4 on a Tiger machine that I use predominantly).  
>> And of course, as Martin said, the copying from Preview is totally  
>> messed up.
> Jens' python script using ghostscript works indeed.
> I had a look inside the pdf files and I think I found the point  
> where things go wrong. It is in fact an ugly conspiracy between  
> Leopard's Preview and Keynote, and both are to blame. Here is the  
> story:
> The select tool in Preview introduces some additional dimensions  
> into the document. The page size is always described by /MediaBox,  
> and the select tool introduces /CropBox, which corresponds to the  
> dimensions of the selected area. Then there are sometimes /BleedBox  
> and /TrimBox which  are unimportant. However, Leopard's Preview  
> introduces additionally /ArtBox and this is where things go wrong.  
> It sets the /ArtBox dimensions to the page size, and Keynote  
> wrongly uses /ArtBox instead of /CropBox to decide which part of  
> the copied pdf to show.
> The workaround is to remove the /ArtBox definition from the pdf  
> that will be pasted, or to set the /ArtBox dimensions to those of / 
> CropBox. Running Jens' gs script removes /ArtBox (In addition, the  
> script says some other rather unfriendly things about the  
> correctness of Apple's idea of pdf specs.)
> BTW, copy-paste from TeXShop does not introduce any of these / 
> CropBox or /ArtBox definitions.
> -- 
> Martin

Hi again,
too bad that such a seemingly small change in Preview's file format  
causes so much trouble. Let's hope that this work-around won't be  
needed for long.

In any case, I've put the script into an AppleScript bundle that  
should be very easy to install. That way, one only needs a single  
additional mouse click after copying from Preview, to get a fixed PDF  
before pasting into Keynote (assuming the Scripts menu bar item is  
The file and installation instructions are at the following URL:

The script should run on any Leopard system provided it has  
ghostscript installed.


More information about the MacOSX-TeX mailing list