ho-tex / oberdiek

Updating the oberdiek bundle
Other
16 stars 6 forks source link

epstopdf prevent rastering fonts #93

Closed lstonys closed 9 months ago

lstonys commented 1 year ago

pdflatex converts eps files to pdf using epstopdf and sometimes it rasterizes some fonts. The same as ps2pdf. The only solution to prevent rasterizing it is to add -dNOCACHE option to ps2pdf (https://tex.stackexchange.com/questions/22095/how-to-prevent-ghostscript-from-rastering-the-font-when-converting-pdf-or-eps-to) Could this option be added to epstopdf script?

I changed eps->pdf command line like this:

\documentclass{article}
\usepackage{graphicx}
\makeatletter
%\AtBeginDocument{\def\ETE@epstopdf #1{ps2pdf -dNOCACHE #1 \OutputFile}}
\makeatother

\begin{document}
fig
\begin{figure}
\centering
\loggingall
\includegraphics[trim=0 0 20mm 15mm, clip, scale=1.00]{rasterize_example.eps}
\end{figure}
\end{document}

and it worked well but I need a solution for all files. Maybe it could be some config (like there is epstopdf-sys.cfg) file where could be added external global options. I've attached eps image
rasterize_example.zip

rasterized

u-fischer commented 1 year ago

something like \def\epstopdf@sys@cmd{epstopdf --gsopts=-dNOCACHE} in epstopdf.cfg should probably work. But as you didn't provide any example and only linked to a over 10 years old discussion about conversion to eps I didn't test.

Generally I would advice to convert files once before the compilation and not doing it on the fly during the pdflatex run. You then have much more control over the result.

lstonys commented 1 year ago

updated. I do not control the input files. I need to recompile various articles.

u-fischer commented 1 year ago

well and did you try my suggestion to adjust epstopdf.cfg?

lstonys commented 1 year ago

Ulrike, you are the best! It works perfectly! Thanks.