将(任何)PDF 转换为纯黑色 (K) CMYK
这与:
...但这里更具体一些:假设我有一个 RGB PDF,其中文本颜色为“浓黑”(R:0 G:0 B: 0 变为 C:100 M:100 Y:100 K:100),以及各种图像和矢量图形。
我想使用免费的命令行工具(因此它可以在 Linux 下批量编写脚本)将其转换为 CMYK PDF,其中的
- 内容仅位于黑色 (K) 通道中:
- 保留矢量图形(+ 文本字形) - 颜色仅在黑色 (K) 通道中变为灰度
- 图像仅转换为黑色 (K) 通道的灰度
提前感谢您的任何回答,
干杯!
This is related to:
- Converting PDF to CMYK (with identify recognizing CMYK).
- Script (or some other means) to convert RGB to CMYK in PDF?
... but a bit more specific here: say I have an RGB PDF, where the text color is "rich black" (R:0 G:0 B:0 gone to C:100 M:100 Y:100 K:100), and diverse images and vector graphics.
I would like to convert this to a CMYK PDF, using a free command line tool (so it is batch scriptable under Linux), which
- has contents only in the black (K) channel:
- Preserves vector graphics (+ text glyphs) - colors become grayscale in black (K) channel only
- Images get converted to grayscale in black (K) channel only
Thanks in advance for any answers,
Cheers!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
正如我对 @Mark Storer 的评论中所暗示的那样,事实证明,仅在 CMYK 中的 K 板上强制进行灰色打印可能不是那么简单......我想这在很大程度上取决于用作“预检”预览设备的设备- 对于 Linux,我唯一能找到的是
ghostscript
和tiffsep
,这是我用于有关 CMYK 分色的“健全性检查”的工具。无论如何,我在
comp.lang.postscript
的这个帖子中得到了很多帮助:...对我有用的一个工作流程是:
ghostscript
的ps2write
将 PDF 转换为 PSghostscript
将此 PS 转换回 PDF,同时执行 HackRGB-cmyk- 中的替换函数inv.psghostscript
的tiffsep
检查实际分离情况
例如,对于 OpenOffice 生成的 PDF:blah-slide.pdf,命令行将是:
这应该只适用于 R=G=B 的 RGB 值(并且希望灰度值),并且仅适用于文本颜色,并且它还会展平文本信息 - 但应该可以通过以下方式确认
tiffsep
文本确实只出现在 K 板上。正如新闻组帖子中提到的,这没有经过广泛的测试,但到目前为止看起来很有希望......
干杯!
As hinted in my comment to @Mark Storer, it turns out that forcing a gray print only on the K plate in CMYK, may not be so trivial ... I guess it depends much on what is being used as "preflight" preview device - for Linux, the only thing I can find is
ghostscript
withtiffsep
, which is what I use for 'sanity check' regarding CMYK separations.Anyways, I got a lot of help in this thread on
comp.lang.postscript
:... and one workflow that works for me is:
ghostscript
'sps2write
ghostscript
to convert this PS back to PDF, while executing replacement functions in HackRGB-cmyk-inv.psghostscript
'stiffsep
to check actual separationsIn respect to, say, this PDF generated by OpenOffice: blah-slide.pdf, the command lines would be:
This should only work on RGB values where R=G=B (and hopefully grayscale values), and only on text colors, and it also flattens text information - but it should be possible to confirm via
tiffsep
that the text indeed ends up only on the K plate.As mentioned in the newsgroup post, this is not extensively tested, but looks promising so far...
Cheers!
作为对 sdaau 伟大答案的改进,我建议使用 xpdf 中的 pdftops 将 pdf 转换为 ps,而不是Ghostscript ps2write,因为后者eg导致字体变得阶梯状,据说不能准确保留原始pdf。通过放大生成的 pdf 的文本区域进行比较。
As an improvement to sdaau's great answer, I can recommend using pdftops from xpdf for converting pdf to ps, instead of ghostscript ps2write, because the latter e.g. causes the font to become staircasey, and is said to not preserve the original pdf accurately. Compare by zooming into text areas of the resulting pdfs.
我建议您使用 GS 将 PDF 转换两次。一次是灰色阴影色彩空间,然后是 CMYK。
我不确定它会起作用,但如果不起作用我会感到有点惊讶。 G->CMYK 听起来像个脑死亡
X -> 0 0 0 X 转换。至少如果你坚持使用“设备灰色”和“设备 CMYK”而不是一些校准的色彩空间,它们会这样那样调整。
I suggest you convert the PDF using GS twice. Once to a Shades Of Gray colorspace, and then to CMYK.
I'm not sure it'll work, but I'd be a bit surprised if it didn't. G->CMYK sounds like a brain-dead
X -> 0 0 0 X
conversion. At least if you stick to "device gray" and "device CMYK" instead of some calibrated color space that'll tweak things this way and that.