[OS X TeX] TeXShop 2.07

Peter Dyballa Peter_Dyballa at Web.DE
Tue Jan 10 10:00:21 EST 2006


Am 10.01.2006 um 03:14 schrieb Richard Koch:

> 	2) Peter Dyballa convinced me to call the ghostscript command ps2pdf
> 	rather than the teTeX script epstopdf when opening an eps file
> 	and converting it to pdf. (If the user selected Apple's distiller  
> in the
> 	TeXShop distiller preference, then as before /usr/bin/pstopdf is  
> used.)
> 	This fixes a problem much discussed in the last few days converting
> 	a particular eps file to pdf.

This has to do with a restriction of epstopdf:

	# The only thing I have not allowed for is the case of
	# "%%BoundingBox: (atend)", which is more complicated.

When the EPS file has in its header

	%%BoundingBox: (atend)

which is accompanied by a

	%%BoundingBox: 17 49 541 702

in the footer epstopdf fails. This was reported a few times on this  
list, for which I recommended to use Apple's 'distiller.' I started  
to understand what epstopdf is doing, but the Perl code is too  
complicated to follow it without being forced to. At least I could  
see that it does one job that ps2pdf is not doing at all: it  
preserves the bounding box! ps2pdf creates pages of EPS code that  
seem to have the size of a page. I cannot remember that I ever had  
problems with such PDF graphics included -- because I used PNG?

Since there are these two problems I thought of an alternative way to  
solve both problems: first convert with ps2pdf and then crop with  
pdfcrop!

A script could be:

	ps2pdf14 -dAutoRotatePages=/None infile.ps /tmp/`id -u`/tmp-outfile.pdf
	pdfcrop --noverbose --hires /tmp/`id -u`/tmp-outfile.pdf infile.pdf
	rm /tmp/`id -u`/tmp-outfile.pdf

pdfTeX produces PDF 1.4, so I think ps2pdf14 is the right script for  
conversion. In case the EPS files has a high resolution bounding box  
it's being cropped according to this. The option -dAutoRotatePages=/ 
None seems to be useful, doing no hurt, although I do not remember  
any more why it is necessary some time.


pdfcrop is a script that first checks whether a Perl script exists  
and if it does, it invokes /usr/local/teTeX/share/texmf.tetex/scripts/ 
pdfcrop/pdfcrop.pl. This one determines the bounding box and then  
invokes pdftex. pdfTeX runs on an artificially assembled TeX file  
which works on the PDF file that ps2pdf14 has created. The final  
statement in the TeX file is

	\page <no.> <four edges>

So the PDF /MediaBox is made up almost (?) correctly -- the  
PostScript 'big points' are preserved, not converted to TeX points.

--
Greetings

   Pete

The human animal differs from the lesser primates in his passion for  
lists of "Ten Best".
-- H. Allen Smith


------------------------- 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