# Latex: Ghostscript call for EPS to PDF conversion failing

I am using eps graph for my work. Latex version is TeXstudio 2.12.10, Miktex 2.9. Code to include graph

\begin{subfigure}{.48\textwidth}
\includegraphics*[width=\linewidth,keepaspectratio=false]{Graph1a.eps}
\caption{$T_d$ under various $V_m$ }
\end{subfigure}


I have included \usepackage{epstopdf} but still, it gives me the error

MiKTeX GPL Ghostscript 9.19: Unrecoverable error, exit code 1 xdvipdfmx:fatal: pdf_ref_obj(): passed invalid object. Output file removed.

Any, help is appreciated.

• can you provide the image Graph1a.eps for a test?
– user2478
Sep 11 '18 at 8:08

I have no problem whle compiling this file, called test.tex, under MiKTeX:

\documentclass{article}
\usepackage[pdftex]{graphicx}
\usepackage{epstopdf}
\begin{document}
\includegraphics*[width=\linewidth,keepaspectratio=false]{FIG1.eps}
\end{document}


Note, however, that, as stated at the epstodpf package dosumentation, the command line should be:

pdflatex --enable-write18 test.tex

• shell-escape is not needed! epstopdf is one of the allowed external programs
– user2478
Sep 11 '18 at 10:33
• actually it's repstopdf, a restricted version of epstopdf that's allowed. Also, use the graphicx package rather than the epstopdf package. Sep 11 '18 at 19:19