[Tex/LaTex] How to make PDF1.5 with epstopdf

epstopdfpdftex

I have a couple of .eps-files that I include in my document with the \includegraphics{} macro. Obviously, this macro will call epstopdf that converts the .eps-file into .pdf, that will then be included.

Now, when compiling my document I see this in the log file:

pdfTeX warning: pdflatex (file ./symbols/sym_full_bridge_rectifier-eps-converted-to.pdf): PDF inclusion: found PDF version <1.7>, but at most version <1.5> allowed

Reading the epstopdf-manual on this link I am informed that I can change the PDF-version of the converted files using the option --gsopt=-dCompatibilityLevel=1.5. This is easily done in a terminal. I have been looking for a way to globally alter ghostscript-options (in a .rc-file or similiar) but I fail.

So, how do I pass that option from within my LaTeX-document?

Best Answer

You can change the command line used with epstopdf by declaring a new graphics rule for eps files.

\documentclass{article}
\usepackage{graphicx}
\usepackage{epstopdf}
\epstopdfDeclareGraphicsRule{.eps}{pdf}{.pdf}{%
  repstopdf --gsopt=-dCompatibilityLevel=1.5 #1 \OutputFile}
\begin{document}
\includegraphics{example.eps}
\end{document}
Related Question