在PDF中将RGB转换为CMYK的脚本(或其他方式)? [英] Script (or some other means) to convert RGB to CMYK in PDF?

查看:41
本文介绍了在PDF中将RGB转换为CMYK的脚本(或其他方式)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以为 Adob​​e Illustrator 或其他一些工具编写脚本来读取大量 PDF 文件的内容并将所有 RGB 颜色转换为 CMYK?

Is it possible to write a script for Adobe Illustrator or some other tool that will read the contents of a number of PDF files and convert all the RGB colours to CMYK?

如果是这样,请有人指出所涉及的一些步骤,或者在哪里可以找到更多相关信息?

If so, could somebody please point out some of the steps involved, or where to find more information on this?

推荐答案

这个答案不是针对 Illustrator,而是针对 'some other tool',即 Ghostscript(下载 gs871w32.exegs871w64.exe).

This answer is not for Illustrator, but for 'some other tool', namely Ghostscript (download gs871w32.exe or gs871w64.exe).

Ghostscript 允许您重新提取"PDF(没有到 PostScript 的中间转换,可怕的重制"绕道).试试这个命令:

Ghostscript allows you to 're-distill' PDFs (without an intermediate conversion to PostScript, the dreaded 'refrying' detour). Try this command:

gswin32c.exe ^
    -o c:/path/to/output-cmyk.pdf ^
    -sDEVICE=pdfwrite ^
    -dUseCIEColor ^
    -sProcessColorModel=DeviceCMYK ^
    -sColorConversionStrategy=CMYK ^
    -sColorConversionStrategyForImages=CMYK ^
     input-rgb.pdf

如果你能再等几周,Ghostscript 9.00 就会发布.这个新版本将首次支持带有 ICC 配置文件的色彩管理(基于 LCMS)...

And if you are able to wait for a few more weeks, Ghostscript 9.00 will be released. This new version will sport support of colormanagement (based on LCMS) with ICC profiles for the first time ever...

更新:我更新了上面的命令,因为我错过了也可以转换图像的选项.

UPDATE: I updated above command because I missed to put in the option to also convert images.

如果颜色转换没有按预期工作,并且如果您看到类似无法将颜色空间转换为灰色,将策略恢复为 LeaveColorUnchanged" 之类的消息,那么...

If color conversion does not work as desired and if you see a message like "Unable to convert color space to Gray, reverting strategy to LeaveColorUnchanged" then...

  1. 您的 Ghostscript 可能是 9.x 版本系列的更新版本,并且
  2. 您的源 PDF 可能使用嵌入的 ICC 颜色配置文件

在这种情况下,将 -dOverrideICC 添加到命令行,然后查看它是否会根据需要更改结果.

In this case add -dOverrideICC to the command line and see if it changes the result as desired.

这篇关于在PDF中将RGB转换为CMYK的脚本(或其他方式)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆