"oopdf2eps", my script to convert PDFs to EPS.

I've previously posted a description of how I use OpenOffice to create EPS files with proper font embedding. The process involves:

  1. exporting to PDF from OpenOffice.
  2. converting the PDF to EPS using "pdftops".
  3. fixing the bounding box using "ps2eps".

I've been doing this so often, that I've created a script I've called "oopdf2eps" to automate the process. Converting to eps now involves executing 1 command:

$ oopdf2eps figure.pdf
pdftops -eps figure.pdf - | ps2eps > figure.eps
Input files: -
Processing: -
Rendering with existing %%BoundingBox: 0 0 792 612
Calculating Bounding Box...ready. %%BoundingBox: 54 43 756 601
Creating output file -...ready.
ps2eps stdout redirected to: figure.eps

Source
Here's the source for the script:

#!/bin/bash

TARGET=${1%.pdf}.eps
echo "pdftops -eps ${1} - | ps2eps > ${TARGET}"
pdftops -eps ${1} - | ps2eps > ${TARGET}

echo "ps2eps stdout redirected to: ${TARGET}"

AttachmentSize
oopdf2eps.gz133 bytes

Comments

Thanks for the tip. Much

Thanks for the tip. Much appreciated. I couldnt get ooimpress to export color eps files.

I had to replace ps2eps with ps2epsi. There has to be a better way than using the intermediate /tmp file. The script now looks like:

#!/bin/bash

TARGET=${1%.pdf}.eps
echo "converting ${1} using 'pdftops -eps' ${1} /tmp/${TARGET}"
pdftops -eps ${1} /tmp/${TARGET}

echo "converting /tmp/${TARGET} using 'ps2epsi /tmp/${TARGET} ${TARGET}' "
ps2epsi /tmp/${TARGET} ${TARGET}
rm /tmp/${TARGET}
echo "ps2eps stdout redirected to: ${TARGET}"

thanks.. it worked

thanks... it worked for me. cool.

Thanks

Another thanks from a latex newby wannabe!
This made my life a lot more easier.

Thanks! Very Useful

Extremely useful Script, Thanks

Excellent

Just what I was looking for. Had a problem with merging 2 pdf files because the fonts were not embedded. This script solved the problem nicely. I could not use the PDF/A-1a option from OpenOffice as this setting does not support transparency...hence the usefulness of this script.

Thanks

Although posted a few years ago, still useful. Thanks.

Two years later

...still really helpful. Thank you!

Thanks

Awesome, thank you.

Very Useful

Extremely useful Script, Thanks a lot