[Tex/LaTex] pdflatex without ghostscript to preserve transparency of included pdfs

ghostscriptgraphicspdfpdftextransparency

I'm trying to include a pdf with a transparent gradient using pdflatex from texlive installed with macports. Using the article class (not standalone), the transparency of the included pdf is lost
when opened with Preview.app (amongst other viewers). Yes, it is there when viewed with Acrobat or Chrome, but I can't force my readers to use these viewers.

I have also noticed this problem when filtering my pdf through ghostscript.

gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=output_gs.pdf white2green1.7.pdf

So while the original file white2green1.7.pdf shows the transparency correctly in Preview.app etc., the new file output_gs.pdf does not.

Is pdflatex running my pdfs through ghostscript? Is there anyway to avoid this?

I have tried reducing the PDF version of the included graphics down to 1.4. I am also unhappy with resorting to rasterizing or flattening the transparency.

For reference, the tex I'm compiling is:

\documentclass{article}
% these two lines don't change the result
\pdfpageattr {/Group << /S /Transparency /I true /CS /DeviceRGB>>}
\pdfoptionpdfminorversion 7
\usepackage{graphicx}
\begin{document}
  \begin{figure}
    \includegraphics[width=\linewidth]{{{white2green1.7}}}
  \end{figure}
\end{document}

Best Answer

When including pdf with features such as transparency or gradients, you should make sure that the version of the pdf created by pdflatex matches the one of the file with the highest version. in this case you should try and make sure that latex create a pdf 1.7 document instead of the default (1.4 or 1.5) This is done by have the following line in your preamble:

\pdfoptionpdfminorversion 7

Also, pdflatex does not add the transparency attribute to the pdf header. this can result in not nice lloking fonts on some pages with some viewers (including adobe reader). The fix for that is adding the following line before the \documentclass{} line.

\pdfpageattr {/Group << /S /Transparency /I true /CS /DeviceRGB>>}
Related Question