Ghostscript は TikZ シャドウを壊しますか?

Ghostscript は TikZ シャドウを壊しますか?

私は自分のドキュメントで派手な TikZ シャドウを使用していますpdflatexが、問題なく動作します。しかし、PDF ドキュメントを ghostscript (またはそのps2pdfフロントエンド) で処理すると、シャドウが壊れてしまいます。この処理は、画像が多いためドキュメントのサイズを小さくすることを目的としているため、無関係な問題であると考えています。

詳細は次のとおりです。MWE:

\documentclass[border=1cm]{standalone}

\usepackage{tikz}
\usetikzlibrary{fit}
\usetikzlibrary{through}
\usetikzlibrary{positioning}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{shadows}
\usetikzlibrary{shadings}
%% even fancier shadows
\usetikzlibrary{shadows.blur}
%% fade
\usetikzlibrary{fadings}

\begin{document}
\begin{tikzpicture}[align=center,node distance = 1.2em and 1.2em,  
  rounded corners=10, blur shadow={shadow blur steps=50}]
  
  \tikzstyle{block} = [rectangle, fill=blue!10, draw, text width=6em,
  text centered, minimum height=2.1\baselineskip,
  blur shadow={shadow blur steps=50}
  ]

  \node (t) [block] {Test};
\end{tikzpicture}
\end{document}

元の文書は次のようになりますlatexmk -pdf mwe:

元のファイル

さて、私はこう呼びかけますgs

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.7  -dPDFSETTINGS=/printer -dColorImageDownsampleType=/Bicubic -dColorImageResolution=72 -dGrayImageDownsampleType=/Bicubic -dGrayImageResolution=72 -dMonoImageResolution=150 -dOptimize=true -q -o small-gs.pdf mwe.pdf

結果は次のとおりです。

gsで壊れた

ps2pdf: を呼び出すこともできますps2pdf mwe.pdf small-2pdf.pdfが、結果は同じです。( のフロントエンドなので当然ですgs。)

ps2pdf で壊れる

バージョン:

$ pdflatex --version
pdfTeX 3.14159265-2.6-1.40.21 (TeX Live 2020)
kpathsea version 6.3.2
Copyright 2020 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.37; using libpng 1.6.37
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 4.02

$ gs --version
9.52

texlive-latestMacOS 10.15.6 および GitLab のビルド システム ( 、Ubuntu イメージ)で検証済み。PDF は Preview.app で表示します。

何が間違っているのでしょうか? (もちろん、プレビューを使用していること以外に)

PDF ファイルのより幅広い互換性を維持するにはどうすればよいですか?

答え1

dvips+のフェーディング(不均一な透明度)のサポートはごく最近ps2pdf追加され、pgfGitHub リポジトリテストするには、ダウンロードしてくださいhttps://github.com/pgf-tikz/pgf/archive/master.zipそしてコピーするtexフォルダーを作業ディレクトリにコピーします。また、Ghostscript-9.52 が必要であり、ps2pdfオプションで実行する必要があります-dALLOWPSTRANSPARENCY

答え2

PDF のバージョンを低くすると、ps2pdf13 mwe.pdf test-pdf13.pdf影のレンダリングが意図したとおりに機能し、役立ちます。サイズは別の問題です...

それは動作します

関連情報