1

Here's a MWE of some path fading I'm doing:

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{fadings}

\begin{document}
\begin{tikzpicture}

\fill [blue!80!black, path fading=east] (0,0) --++ (90:0.3) --++ (0:6) --++ (-90:0.3) -- cycle;

\end{tikzpicture}
\end{document}

I've noticed that although this shows up fine for me with my pdf viewer (Evince 3.28.2), it doesn't show up on some others.*
And twice I've printed it on different printers and it doesn't show up then either.

Does anyone know about any peculiarities of pdfs generated with TikZ that lead to this difficulty in printers/viewers interpreting them?

(I'm using pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014))


*With Preview on a Mac (version 8.1), the fade shows up if you directly include the tikzpicture in your document with \input, but not if you generate a standalone pdf and do \includegraphics{path/to/generated/pdf}

Having just found this out, I haven't tried printing the \input version yet.


Edit: follow up question based on information from the answers. Since transparency as a feature may not be supported by all printers, is there a way to emulate transparency in TikZ without actually using it?

  • Did you try printing from a different viewer – percusse May 9 '18 at 10:50
  • @percusse No I haven't. Does the viewer used affect what information is sent to the printer? – thosphor May 9 '18 at 11:02
  • Sometimes the following workaround helps: open the pdf in a viewer that shows the fading, print it from there as pdf file. Now try to open the new pdf file with one of the affected pdf readers or print it. – user36296 May 9 '18 at 13:36
  • This happens when printer drivers don't support PostScript operations properly. So better update the drivers first before attempting any hacks – percusse May 9 '18 at 16:16
2

The introductory words of the pgf manual on transparency (ch 23) explicitly state that transparency, fading, and blending are advanced features not fully supported by all viewers, renderers, let alone printers. Essentially, you are at the will of the designer/manufacturer of your pdf display entity, be that viewer or printer. I've encountered the same problem before, with a fading visible only in the Adobe Reader, not the Mac Preview.

Nothing you can do other than choosing the right viewer/printer (if it is for yourself) or draw it in such a way that you have no compatibility issues with other users.

You may attempt options such as opening the file and printing to pdf (possible natively in Mac) in order to process your drawing. However, especially if you are working with others, do not use features that imply compatibility issues. You don't know their setup.

Relevant paragraph from pgf manual:

Note: Transparency is best supported by the pdfTEX driver. The svg driver also has some support. For PostScript output, opacity is rendered correctly only with the most recent versions of Ghostscript. Printers and other programs will typically ignore the opacity setting.

  • 1
    Nothing you can do other than choosing the right viewer/printer ... not exactly true. If you have Acrobat you can "optimize" the transparency by flattening the file and making it compatible with Acrobat 4.0 that has no transparency. – Kpym May 9 '18 at 13:56
  • So are there any libraries/functions which can emulate transparency and therefore avoid the associated problems? – thosphor May 9 '18 at 14:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.