Friday, 4 May 2012

Batch converting PDF to EPS

Today I found myself needing to convert about 20 vector images from PDF to EPS, because a journal that I want to submit an article to, demands that all graphics are in EPS format.

Searching the net, I found several solutions, many of them involving the pdf2ps or pdftops command-line utilities. The best solution was the one I found here, which converts all the images in a folder with a single-line for loop:

for f in *.pdf; do pdftops -eps $f; done

The code is run on the command line. I've only tried this in Linux, but some version of it may work in Windows or OSX as well.

9 comments:

Anonymous said...

Don't forget to include a semi-colon after $f, followed by the syntax 'done', to close the for-loop.

Martin H. Skjelvareid said...

Thanks! I've updated the post with the correct syntax. I probably made some kind of copy-paste error in the original post.

Unknown said...

Hi, Thanks for your help, I've got a problem with this command line, my pdf are in landscape but the eps exported are in portrait ?

Unknown said...

This is a bug of poppler, same command with xpdf worked perfectly

Martin H. Skjelvareid said...

Hello Nicolas, glad you figured it out! And thanks for letting me (and everybody else) know.

Mitch said...

Thanks! Very helpful!

Unknown said...

Can you explain how to execute this line of code?

Martin H. Skjelvareid said...

The code is executed directly in a Linux terminal (inside the folder containing the PDF documents). It might be possible to do something similar in Windows or OSX.

Unknown said...

Ah, my apologies. I was searching far and wide for a few answers and I failed to realize this was a Linux blog. I'm just going to mention that I wound up creating a new action using the Acrobat Pro action wizard to batch convert my files and that it worked very well.

Post a Comment