Transparent gradients in included pdfs using pdflatex lost by Preview.app

Alec Jacobson

August 22, 2013

weblog/

I'm running into this issue again. pdflatex on mac os x installed using macports via texlive somehow garbles pdfs with transparent gradients so that they don't view correctly with Preview.app. The original PDF looks correct with my Preview.app: linear gradient fails with pdflatex on mac with preview

Try compiling a small test document:

\documentclass{article}
\pdfpageattr {/Group << /S /Transparency /I true /CS /DeviceRGB>>}
\usepackage{graphicx}
\begin{document}
\begin{figure}
\includegraphics[width=\linewidth]{white2green.jpg}
\includegraphics[width=\linewidth]{{{white2green1.7}}}
\includegraphics[width=\linewidth]{{{white2green1.3}}}
\end{figure}
\end{document}

For me the middle image doesn't show up correctly. Of course the jpg does, but it's pure raster. The last image is a pdf, but it's a hacky solution. If you save your pdf with linear gradients in Illustrator as Compatibility: Acrobat 4 (PDF 1.3) then Illustrator will raster your transparency. It does a halfway decent job and it seems that the pdf is forward compatible: you can still edit it in Illustrator as vector graphics.