Code covered by the BSD License  

Highlights from
eps2pdf

4.78947

4.8 | 19 ratings Rate this file 60 Downloads (last 30 days) File Size: 4.23 KB File ID: #5782

eps2pdf

by

 

25 Aug 2004 (Updated )

Converts an EPS file to a PDF file.

| Watch this File

File Information
Description

EPS2PDF converts an existing EPS file to a PDF file using Ghostscript. EPS2PDF reads an eps file, modifies the bounding box and creates a pdf file whose size is determined by the bounding box and not by the paper size. This can not be
accomplished by using Ghostscript only. So, all that one needs is of course MATLAB and Ghostscript drivers.

This tool is especially suited for LaTeX (TeX) users who want to create pdf documents on the fly (by including pdf graphics and using either pdftex or pdflatex). An example would be, if you are using LaTeX (TeX) to typeset documents then the usual (simple) way to include graphics is to include eps graphics using for example (if there exists myfigure.eps)

\begin{figure}
  \centering
  \includegraphics[scale=0.8]{myfigure}\\
  \caption{some caption.}
\end{figure}

To use pdflatex (pdftex) you do not need to change anything but provide another file myfigure.pdf in the same directory along with myfigure.eps. And this file, of course, can be generated by EPS2PDF.

Acknowledgements

This file inspired Savefig.

MATLAB release MATLAB 6.5.1 (R13SP1)
Other requirements Ghostscript
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (22)
29 Mar 2014 Jeppe Druedahl

This is very good script. On a 64-bit Windows 7 machine I sometimes get the error

"r6016: not enough space for thread data"

The error disappears when I use a 32-bit version of Ghostscript.

22 Apr 2013 David T

This script has worked very well for me through Windows XP and Windows 7. Note, that you do need to locate the exact path to the ghostscript file on your local drive. The example provided in the .m notes is just that, an example and will likely not reflect where the gs file is located on your machine.

For Windows 7, i found that the OS doesn't have a suitable gs to path to. www.ghostscript.com has a free download for ghostscript 9.07 which resolves this problem. Just path to the .exe and change the eps2pdf script to the correct file name and you're all set.

05 Nov 2012 Spase

I just downloaded the code but I’m having a problem using it.
I have a Ghostscript version 9.05 running on 64 bit Windows 7, so I changed the part of the code to be gswin64c.exe instead of gswin32c.exe, and I included the right path as input argument, but it shows me the error “Ghostscript executable could not be found: c:\programfiles\gs\gs9.05\bin\gswin64c.exe”

Does anyone have any idea how could I solve this?

23 Aug 2012 Eike  
18 Feb 2012 Marmar

Many thanks for this helpful code. Would you please let me how you give the resource and dest addresses via an example?

27 Nov 2011 Maria

This is genial and works on Linux!!! I am glad I have found this page!

Big big thanks!

25 Oct 2011 Uli

Great job. Thanks a lot!

03 Aug 2011 Folkert

Beware that this does not embed fonts in the PDF generated! I used this to create figures for an IEEE paper (which requires all fonts to be embedded) with pdflatex. The only way to get all fonts embedded was to embed them in the figures.

I did this by adding the following options to GS_PARAMETERS:

-dEmbedAllFonts=true
-dSubsetFonts=true
-dCompatibilityLevel=1.4
-dPDFSETTINGS=/printer

It might be an idea to include these options by default or to comment on this in the comment for the file.

Apart from that it is a great function, I combine it with the function 'exportfig'.

01 Nov 2010 Ran

This is exactly what I want!

12 Apr 2010 J.Paul Rinehimer  
18 Sep 2009 Fabio Caponetti

Works smoothly under Linux!:)

10 Sep 2008 Mark Tschopp

This script works great!

21 May 2008 Zhaowen Wang

it helps a lot!

17 Apr 2008 h h

c

03 Dec 2007 Jan K.

wonderful, thank you very much!

13 May 2007 Ryan Edwards

This function is exactly what's needed to convert EPS files printed from MATLAB into PDF's that can be interpreted correctly by pdflatex. (A rant: I think it's stupid that pdflatex cannot directly place EPS or PS files when standard latex can. I'm sure there's a reason, but I still think it's stupid. Annoying nuances like this will keep people using Word). Anyway, I'm looking forward to putting this function through its paces with some papers I'm writing. Many thanks for this contribution.

20 Mar 2006 dsg dghnd  
19 Feb 2006 Sebastian F

Just what I was looking for!!!!!!!!!!
Thanks, thanks, thanks!!!!

08 Feb 2006 evgeni lomonosov

great!

02 Sep 2005 Steve B

Thanks!!!! This is perfect!

21 Jun 2005 Michael Hofer

Very useful, many thanks!

03 Sep 2004 Behzad Samadi

Excellent! Thanks a lot Primoz! After a few hours of searching, I found the perfect answer here.

Updates
27 Aug 2004

Optimized for speed

Contact us