4.15 How to convert pdf to eps?

See http://tex.stackexchange.com/questions/20883/how-to-convert-pdf-to-eps This inkscape input.pdf --export-eps=output.eps works ok, but the above command gives errors such as these on some images:

>inkscape 3d_1.pdf --export-eps=3d_1.eps 
** Message: Invalid glyph found, continuing... 
** Message: Invalid glyph found, continuing... 
** Message: Invalid glyph found, continuing... 
** Message: Invalid glyph found, continuing... 
** Message: Invalid glyph found, continuing... 
** Message: Invalid glyph found, continuing... 
** Message: Invalid glyph found, continuing... 
** Message: Invalid glyph found, continuing...
 

While on the same file, pdf2eps below works fine.

To crop pdf also (which can be useful) use this script by Herbert from above link

#!/bin/sh 
# $Id: pdf2eps,v 0.01 2005/10/28 00:55:46 Herbert Voss Exp $ 
# Convert PDF to encapsulated PostScript. 
# usage: 
# pdf2eps <page number> <pdf file without ext> 
 
pdfcrop $2.pdf 
pdftops -f $1 -l $1 -eps "$2-crop.pdf" 
rm  "$2-crop.pdf" 
mv  "$2-crop.eps" $2.eps
 

I wrote the following simple script prep which process all the pdf image files and generates the needed files for tex4ht.

#!/bin/bash 
for file in $1; do 
    filename=${file%.*} 
    pdf2svg "$filename.pdf" "$filename.svg" 
    pdf2eps 1 "$filename" 
done
 

It is called like this prep "*.pdf" or for one file prep foo.pdf it will generate a .svg and .eps for each file.