Re: possible issue with ps2pdf (9.25) and transparency

Ken Sharp <[email protected]> Sat, 15 Sep 2018 16:04:00 +0100
Newsgroups gmane.comp.printing.ghostscript.devel
Message-ID <[email protected]>
At 08:13 15/09/2018 -0600, Nelson H. F. Beebe wrote:

>is processed with TeX Live 2018 by the steps
>
>     latex test-transparency.ltx
>     dvips test-transparency.dvi
>     ps2pdf test-transparency.ps
>
>I have verified this locally on an Ubuntu 16.04 box: using the
>vendor-supplied ps2pdf version 9.16 in the last step produces
>transparent overlapping circles, while ps2pdf version 9.25 from the
>local build that I did earlier this week produces red and blue
>opaquely painted circles.
>
>Can others on this list confirm this apparent misbehavior?

Without a complete Ghostscript command line, and an example file to look 
at, no.

I can guess, but that's all it is without more information.

Assuming that 'test-transparency.ps' uses Ghostscript extension operators, 
then its not misbehaviour, its a deliberate policy when -dSAFER is set. 
Note;  I believe that, in common with most of the shell scripts, ps2pdf 
sets -dSAFER.

As a result of the security hardening in the aftermath of the recent 
publicly disclosed vulnerabilities, we've made a number of non-standard 
PostScript operators unavailable when -dSAFER is set. In particular this 
includes the 'transparency' operators.

This policy is likely  to be extended in future and more non-standard 
operators will be made unavailable (and in some cases, removed entirely) 
when -dSAFER is set.

This is because every Postscript operator is potentially vulnerable to 
attack, so to reduce the exposure (when the user selects -dSAFER) we intend 
to make non-standard operators unavailable, as far as possible. In future 
if you want to use non-standard operators you will have to run without SAFER.

So our own example file 'transparency-example.ps' in ghostpdl/examples 
throws an error when processed with -dSAFER, because none of the 
transparency operators can be found. A program which runs the operators in 
a stopped context, or has a custom error handler might simply render 
opaque, as described.

In a closed workflow such as described above, the simple answer is to not 
set -dSAFER, for the existing shell scripts additionally setting -dNOSAFER 
on the command line for the script should, I believe, disable it.

I'd suggest trying that, you could also simply invoke Ghostscript directly 
with something like:

gs -sDEVICE=pdfwrite -o out.pdf test-transparency.ps



                         Ken