我习惯于使用下面的代码来转换带有rgb图片的pdf:
gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pdfwrite \
-dEmbedAllFonts=true \
-dPDFSETTINGS="/prepress" \
\
-sColorConversionStrategy=Gray \
\
-dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode \
-dAutoFilterGrayImages=false -dGrayImageFilter=/FlateEncode \
-dMonoImageFilter=/FlateEncode \
\
-dDownsampleColorImages=false \
-dDownsampleGrayImages=false \
-dDownsampleMonoImages=false \
\
\
-sOutputFile=$4 \
-f "$1"
使用此代码不会更改该图片的颜色模式。
如果用gs将包含的图片转换为灰色(这是一个用inkscape修改并保存为rgb的pdf格式),则在使用latex创建pdf之前,它可以工作。
使用的GS版本为9.26。已使用数据的链接:
发布于 2019-07-12 16:27:40
查看‘灰色转换的pdf’文件,我看到,内容完全是在DeviceGray。那你为什么认为不是呢?你是如何确定“颜色模式”的?
PDF文件确实包含透明(毫无意义,但对您来说是Cairo ),并且具有DeviceRGB混合模式。这不是Ghostscript的pdfwrite可以改变的东西,如果它改变了混合模式,那么输出中可能会发生一些不好的事情。
https://stackoverflow.com/questions/57007607
复制相似问题