[OS X TeX] Fixed epstopdf, which handles %%BoundingBox: (atend) OK.

Gerben Wierda Gerben.Wierda at rna.nl
Sun Jan 29 17:09:48 EST 2006


Please all, try the fixed epstopdf to be found on

	ftp://ftp.nluug.nl/pub/comp/macosx/epstopdf

(Replace the one in /usr/local/teTeX/bin/....)

I already had "%%BoundingBox: (atend)" code in there but it was  
seriously broken. It has never worked, only produced damaged EPS for  
GS to convert to PDF. I am embarassed because it was so very, very  
broken that I must never have tested this, or some sort of  
intermediate version somehow was promoted to final again at a later  
date (I think this is more likely as I recall having had a correct  
version when I developed my fixes). In any case, I screwed up.

But the above should work. Again, because of a lack of time I cannot  
guarantee anything, but the algorithm is simple and therefore: if it  
is wrong, it should immediately show up in a test . I ran one test  
and it worked fine. (testing is generally a bad substitute for  
design, but hey, this was not my code to begin with and in this case  
a test is probably OK)

G

Some background:

The problem always was to combine scanning for (atend) with  
uncertainty about the line ending character used and perl's inability  
to use a regular expression as input line separator. Before this  
script was used on Mac OS X, a line ending was either DOS CRLF or  
Unix LF. Now, to be usable with all those old files from classic Mac  
OS, it had to be able to handle anything. That was the fix I made  
several years ago.

To be able to detect line ending, I employed a trick. The trick is to  
read a certain number of bytes and try to guess the line ending from  
that. Then I wrote difficult code to be able to keep using what was  
already read, because I cannot close and open the stream again if  
epstopdf is used as filter. I was just hacking, not doing serious  
maintenance as I was under the impression someone else maintained it.

Now, the code to keep using what was already read from the input was  
broken, but it was only used in case of atend, when the bounding box  
at the end had to be found first, after which the input file is  
patched and then sent to gs to turn it into PDF.

In the case of (atend) the whole file ends up in memory. So a  
combination of (atend) and huge EPS files is taxing. I personally  
would probably design the whole thing differently, but as it is, it  
is good enough.

On 29 Jan 2006, at 15:09, Gerben Wierda wrote:

> epstopdf should handle (atend) already. Maarten sent me a file.  
> From that I can see that epstopdf is actually buggy. As I have  
> become the maintainer of this file, I will see to it that it gets  
> fixed.
>
> My apologies for probably having produced this bug in the first place.
>
> G
>
>
> On 29 Jan 2006, at 11:41, Gerben Wierda wrote:
>
>> On 28 Jan 2006, at 22:14, Maarten Sneep wrote:
>>
>>> If you need the bounding box respected _and_ access to TeX fonts,  
>>> you need epstopdf, unless the eps specifies the bounding box at  
>>> the end of the file. Then you need to jump through hoops to get  
>>> the conversion correct (I would advise to avoid tools that  
>>> produce such output if possible).
>>
>> If someone sends me a recursive EPS with (atend) (that is, an EPS  
>> which itself has the Bbox atend and which uses %%BeginDocument  
>> inclusion of another EPS which has atend) I would like to try to  
>> see if an idea that I have works.
>>
>> G------------------------- Info --------------------------
>> Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
>>          & FAQ: http://latex.yauh.de/faq/
>> TeX FAQ: http://www.tex.ac.uk/faq
>> List Archive: http://tug.org/pipermail/macostex-archives/
>>
>>
>
> ------------------------- Info --------------------------
> Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
>          & FAQ: http://latex.yauh.de/faq/
> TeX FAQ: http://www.tex.ac.uk/faq
> List Archive: http://tug.org/pipermail/macostex-archives/
>
>

------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/




More information about the MacOSX-TeX mailing list