我有几个sRGB PDF数字,我试图转换成CMYK作为一个可接受的文件。由于我在一步内没有看到解释整个过程的帖子,所以我决定先做sRGB PDF -> CMYK PDF,然后再做CMYK PDF -> CMYK EPS。第二步是我陷入困境的地方,但我将包括完整的整个过程。
我用下面的数字说明我的问题,其中第一个如果输入。这三个数字在压缩文件https://www.dropbox.com/s/7wr84bqhp3rzagg/figs.zip?dl=0中。
为了方便其他问题,我将使用这些数字。几个小时后,我终于能够将sRGB PDF (1)转换为CMYK (2),方法是将来自Converting PDF to CMYK (with identify recognizing CMYK)的答案组合在一起。最困难的部分是让‘识别’检测到新的PDF实际上是CMYK。我使用了Chris的讨厌的技巧来让这个转换步骤开始工作。然后,我调用identify命令:
identify -format '%[colorspace]' figure_1_cmyk.pdf上面写着CMYK,到目前为止还不错。下一步应该很简单,我想,只需将CMYK PDF转换为CMYK EPS。但这才是我真正被困的地方。我在(2)上使用下面的bash脚本'pdf2eps.sh‘来获得(3)。
#!/bin/bash
gs \
-dNOPAUSE \
-dNOCACHE \
-dBATCH \
-dNOSUBSTDEVICECOLORS \
-sDEVICE=eps2write \
-sOutputFile="${1%%.pdf}.eps" \
"$1"无论是否使用'-dNOSUBSTDEVICECOLORS‘标志,生成的.eps文件(3)都会以“标识”检测到的方式返回到sRGB。您可以使用所提供的数字进行检查。我真的不知道我还能尝试什么,但我对幽灵剧本也很陌生。如果一个比我有更多知识的人能教我如何成为CMYK,我将非常感激。
会不会是那辆车的车?我不知道其他使用linux工具来检查(3)是否实际上是CMYK的方法。如果有更容易的方法获得sRGB PDF到CMYK高质量,我会感兴趣,当然。命令行工具“转换”不会给我带来好的结果。
真诚的,布拉姆
P.S.由于其中一个答案提出了请求,我用于第一步的代码(RGB -> CMYK )如下:
巴什脚本
#!/bin/bash
gs \
-dPDFX \
-dBATCH \
-dNOPAUSE \
-dNOOUTERSAVE \
-dPDFSETTINGS=/prepress \
-dCompatibilityLevel=1.5 \
-sDEVICE=pdfwrite \
-sColorConversionStrategy=CMYK \
-sProcessColorModel=DeviceCMYK \
-dHaveTransparency=false \
-sOutputFile="${1%%.pdf}_cmyk.pdf" \
PDFX_def_fogra39_trickcmyk.ps \
"$1"添加了“PDFX_def_fogra39_trickcmyk.ps”文件
%!
% $Id$
% This is a sample prefix file for creating a PDF/X-3 document.
% Feel free to modify entries marked with "Customize".
% This assumes an ICC profile to reside in the file (ISO Coated sb.icc),
% unless the user modifies the corresponding line below.
systemdict /ProcessColorModel known {
systemdict /ProcessColorModel get dup /DeviceGray ne exch /DeviceCMYK ne and
} {
true
} ifelse
{ (ERROR: ProcessColorModel must be /DeviceGray or DeviceCMYK.)=
/ProcessColorModel cvx /rangecheck signalerror
} if
% Define entries to the document Info dictionary :
% /ICCProfile (/usr/share/color/icc/ISOcoated_v2_300_eci.icc) def % Customize or remove.
[ /GTS_PDFXVersion (PDF/X-3:2002) % Must be so (the standard requires).
/Title (Title) % Customize.
/Trapped /False % Must be so (Ghostscript doesn't provide other).
/DOCINFO pdfmark
% Define an ICC profile :
currentdict /ICCProfile known {
[/_objdef {icc_PDFX} /type /stream /OBJ pdfmark
[{icc_PDFX} <</N systemdict /ProcessColorModel get /DeviceGray eq {1} {4} ifelse >> /PUT pdfmark
[{icc_PDFX} ICCProfile (r) file /PUT pdfmark
} if
% Define the output intent dictionary :
[/_objdef {OutputIntent_PDFX} /type /dict /OBJ pdfmark
[{OutputIntent_PDFX} <<
/Type /OutputIntent % Must be so (the standard requires).
/S /GTS_PDFX % Must be so (the standard requires).
/OutputCondition (Commercial and specialty printing) % Customize
/Info (none) % Customize
/OutputConditionIdentifier (FOGRA39) % Customize
/RegistryName (http://www.color.org) % Must be so (the standard requires).
currentdict /ICCProfile known {
/DestOutputProfile {icc_PDFX} % Must be so (see above).
} if
>> /PUT pdfmark
[{Catalog} <</OutputIntents [ {OutputIntent_PDFX} ]>> /PUT pdfmark
[/_objdef {OutputIntent_PDFX} /type /dict /OBJ pdfmark
[{OutputIntent_PDFX} <<
/ColorSpace /DeviceCMYK % convince ImageMagick's identify that it's CMYK
/Type /OutputIntent % Must be so (the standard requires).
/S /GTS_PDFX % Must be so (the standard requires).
/OutputCondition (Commercial and specialty printing) % Customize
/Info (none) % Customize
/OutputConditionIdentifier (CGATS TR 003) % Customize
/RegistryName (http://www.color.org) % Must be so (the standard requires).
currentdict /ICCProfile known {
/DestOutputProfile {icc_PDFX} % Must be so (see above).
} if
>> /PUT pdfmark
[{Catalog} <</OutputIntents [ {OutputIntent_PDFX} ]>> /PUT pdfmark发布于 2017-02-21 08:21:54
首先,您使用的是Ghostscript (9.18)的稍旧版本,当前版本为9.20,9.21将很快发布。
第二,你可以一步一步完成整个工作。您还没有说明用于创建CMYK的命令行,但是如果在该命令行中使用eps2write而不是pdfwrite,则应该得到CMYK而不是CMYK。这两个设备实际上共享了99%以上的代码,大多数命令行交换机与这两种设备的工作原理相同。
NOSUBSTDEVICECOLORS开关本质上是严格的,现在根本不应该使用。
最后,您还没有给出一个很好的理由说明为什么您认为EPS文件是而不是 CMYK。在这里我不认为“识别”是一个有用的工具。检测在PostScript程序中使用的颜色空间的唯一方法是充分解释它,并且识别不是PostScript解释器!我猜想它使用Ghostscript来渲染EPS,图像的颜色空间将取决于Ghostscript设备用于渲染的是什么。
在您的输出文件中,我看到颜色是通过以下方法指定的:
0.875 0.765625 0 0 k
0.875 0.765625 0 0 K/k和/K被定义为:
/k/setcmykcolor load def
/K/setcmykcolor load def如果文件使用RGB颜色,那么您可能会看到“RGB”或“RGB”,这两种颜色都不在EPS文件的正文中。
因此,是的,它的识别是错误的,虽然我并不特别指责它,我相信它的目的是用于位图图像,而不是高级的页面描述语言。正如我前面提到的,如果您使用命令行创建CMYK并将设备设置为eps2write,那么您应该在一个步骤中得到一个CMYK。注意,因为EPS是为了包含在其他程序中,所以它不能包含多个页面,所以如果您从多页输入开始,您应该使用'%d‘文件名语法来获得多个EPS文件,每页一个。
编辑这里的许多内容是多余的,或者在创建中间文件时可能有害:
gs \
-dPDFX \
-dBATCH \
-dNOPAUSE \
-dNOOUTERSAVE \
-dPDFSETTINGS=/prepress \
-dCompatibilityLevel=1.5 \
-sDEVICE=pdfwrite \
-sColorConversionStrategy=CMYK \
-sProcessColorModel=DeviceCMYK \
-dHaveTransparency=false \
-sOutputFile="${1%%.pdf}_cmyk.pdf" \
PDFX_def_fogra39_trickcmyk.ps \
"$1"制作PDF/X限制了PDF文件的允许构造,这意味着在不一定需要的情况下,您将返回到较低级别的默认设置。如果不设置PDF/X,那么也不需要PDF/X_def.ps文件,因为所做的就是设置默认值。
您不需要设置-dHaveTransparency=false,首先是因为它被PDF/X代码所包围,其次是因为PostScript不支持透明性,所以如果您直接使用EPS,也会为您提供服务。
您不应该使用任何 PDFSETTINGS,除非您有充分的理由(并且可以向我解释它;-)
同样,限制PDF级别(而且pdfwrite不会使用1.5以上的特性创建PDF)
不要使用NOOUTERSAVE,在这种情况下所做的一切都是为了降低性能.
对于当前的代码,如果您设置了ColorConversionStrategy,那么它将为您设置ProcessColorModel,因此您也不需要这样做。
我建议这样做:
gs \
-dBATCH \
-dNOPAUSE \
-sDEVICE=eps2write \
-sColorConversionStrategy=CMYK \
-sOutputFile="${1%%.pdf}_cmyk.eps" \
"$1"https://stackoverflow.com/questions/42358680
复制相似问题