# Ubuntu – Why won’t .pdf files containing transparent elements print correctly

evincepdfprinting

I have recently encountered a problem printing .pdf files containing transparent elements. I first noticed it when printing a document created with LaTeX that included embedded .png images with alpha channels and embedded .pdf figures with transparent elements. The document would look fine on the screen but when printed the pages containing embedded graphics would appear to be bitmapped at a low resolution.

I later found this would also occur when printing some of the .pdf figures individually so the problem is not specifically to do with LaTeX. I also found that the documents will generally print OK with Adobe Reader in Linux, but they take a very long time to print. The documents also appear to print OK with Adobe Reader in Windows. This suggests the problem lies with the Evince (the default .pdf viewer) or something in the printing sub-system between document and printer. I speculate that Adobe Reader in Linux is unaffected by the problem because it rasterizes the page images itself at an acceptable resolution or otherwise communicates with the printer differently. Unfortunately I don't know enough about Ubuntu's print sub-system to locate the source of the problem but it definitely seems like a bug.

I am using Ubuntu 12.04, Evince Document Viewer 3.4.0 using poppler/cairo (0.18.4) and CUPS 1.5.3

There are a number of related questions but the following two are the most relevant:

Flattening PDF Transparency – The best answer here is to use Acrobat Professional in Windows to flatten the transparency, but I don't have easy access to this software.

Why do some vector graphics included into a document force rasterization of the whole page and subsequently ruin the look of the text in cups? – The best answer here is to use ghostscript to convert the .pdf to a version that doesn't support transparency effects, but this simply rasterizes the file rather than flattening the transparency.

None of the answers to these questions really get to the root of the problem, i.e. how come the files print OK in Adobe Reader in Windows (and in Linux, albeit slowly) but not with the default .pdf viewer Evince?

My own workaround is simply to ensure there are no transparent elements in the .pdf figures in the first place. Where transparent effects are essential I save the figures as .png at a sufficiently high resolution for printing. If necessary any .png alpha channels can be removed using Gimp. I have found no way to flatten a .pdf in Linux without rasterizing it.

Can anyone suggest a resolution or at least a better workaround?

You can use apt install okular