[OS X TeX] EPS to PDF conversion fails in graphicx (but not in preview)

Themis Matsoukas tmatsoukas at me.com
Fri Dec 3 12:02:04 EST 2010


On Dec 3, 2010, at 9:00 AM, Siep Kroonenberg wrote:

> On Thu, Dec 02, 2010 at 08:21:01AM -0800, Michael Sharpe wrote:
>> 
>> On Dec 2, 2010, at 8:01 AM, Herbert Schulz wrote:
>> 
>>> 
>>> On Dec 2, 2010, at 9:44 AM, Themis Matsoukas wrote:
>>> 
>> 
>> One way to filter out garbage like this is to
>> 
>> 1. change the extension to .ps;
>> 2. ps2eps -l aics5.ps
>> 
>> (The option in the last command is a lower case l, which makes a loose bounding box.)
>> 
>> The resulting eps works fine, and has any bounding box errors corrected.
>> 
>> Michael
> 
> The garbage is an eps preview header. This is defined in Adobe's
> official eps documentation. You can remove the preview with a script
> based on Adobe's specification:
> 
> #!/usr/bin/perl
> undef $/;
> $ALL = <>;
> 
> if (substr ($ALL, 0, 2) eq "%!") {
>  print $ALL;
> } else {
>  @toc = unpack "VV", substr ($ALL, 4, 8); # offset, l. of PS part
>  print substr ($ALL, $toc[0], $toc[1]);
> }
> 

I have followed the various suggestions. The question remains, however, that the problematic eps file is converted properly by preview but not by epstopdf. Here is a more recent version of that file. This version was annotated heavily in AI and, paradoxically, epstopdf converts it properly, unlike the earlier version. This too contains Adobe garbage but, apparently, not toxic enough to give eps2pdf a bad stomach.

Themis


-------------- next part --------------
A non-text attachment was scrubbed...
Name: aic5b.eps
Type: image/eps
Size: 658294 bytes
Desc: not available
URL: <http://email.esm.psu.edu/pipermail/macosx-tex/attachments/20101203/a1272066/attachment.bin>


More information about the MacOSX-TeX mailing list