使用 ps2pdf (ghostscript) 创建正确的 PDF/X

Creating correct PDF/X with ps2pdf (ghostscript)

几天来我一直在为这个问题苦苦挣扎,所以我想我应该在这里寻求帮助...

基本上,我正在尝试使用 ps2pdf(版本 9.10)创建正确的 PDF/X-1 和 PDF/X-3 文档。是的,我知道据说 ps2pdf 只支持 PDF/X-3(参见 this thread and this thread and )。然而,由于 PDF/X-1 基本上是 PDF/X-3 的一个子集,我想这样的转换应该是可能的。另外,使用命令...

gs -sDEVICE=pdfwrite -dPDFX -dBATCH -dNOPAUSE -dNOOUTERSAVE -sProcessColorModel=DeviceCMYK -sOutputFile=out.pdf PDFX_def.ps in.pdf

我注意到我正在创建的 PDF/X-3 文件的颜色被转换为 CMYK,而不是将它们保留为 RGB(PDF/X-3 应该是这种情况)。因此,从技术上讲,文件现在是 PDF/X-1:我可以通过将“/GTS_PDFXVersion (PDF/X-1a:2003)”添加到 PDFX_def.ps 和 运行 来确认通过 Adob​​e 的预检文件。

这让我想到了问题的第一部分:如何防止将原始 PDF 文档中定义的 RGB 颜色转换为 CMYK?开关“-dColorConversionStrategy=/LeaveColorUnchanged”似乎没有任何效果。 (实际上,我读到 here 这种转换甚至是不可能的。那么,为什么会发生这种情况?或者这是过时的信息?)

其次,为什么 documentation 说 "RGB is not allowed" 与“-dPDFX”结合使用?这不就是 PDF/X-3 的意义所在吗?

第三,是否也可以创建通过 Adob​​e 预检的 PDF/X-4 文档?

顺便说一下,这是我的 PDFX_def.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 (Blurb_ICC_Profile.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 (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 (ISOcoated_v2_300_eci.icc) % Customize
  /Info (Info)                     % Customize
  /OutputConditionIdentifier (Custom)      % 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

提前致谢!

好的,首先你 不能 使用 pdfwrite 生成 PDF/X-1,因为 PDF/X-1 中颜色支持的限制。现在实际上 几乎 可以做到,但是 Separation 和 DeviceN color spaces 没有转换为设备 spaces,需要转换。

其次,你应该真正使用当前版本的 Ghostscript (9.16)。

正如您稍后在回答中指出的那样,文档指出您不能使用 /RGB。所以你的 RGB 颜色被转换为 CMYK 的原因是因为你不能使用 RGB(见后面)。

您引用的 Ghostscript 错误报告已有 5 年历史,5 年前的真实情况已不再真实(近 2 年前发布 9.10 时已不再真实)。但是,正如我上面提到的,您仍然无法生成 PDF/X-1,这就是该错误仍然存​​在的原因。有些工作已经完成,还有更多工作要做。

结合 PDFX 设置 ColorConversionStrategy 没有效果,因为 PDFX 的颜色转换要求取代了命令行中的 ColorConversion。

您不能在 PDF/X-1 文档中使用 DeviceRGB space,除非您指定 DefautlRGB 颜色 space,它本身不是 DeviceRGB 或 DeviceN space。我记得目前在 pdfwrite 中没有规定指定 DefaultRGB space,这就是为什么你不能使用 DeviceRGB 的原因。

终于;不,您还不能使用 pdfwrite 设备生成 PDF/X-4 文件。

好吧,KenS 的回答应该被认为是这个问题的正确答案,但是我已经大量参与标准工作几年(现在大约十五岁:)),我想添加一些更一般的陈述。

PDF/X-1a
请参考 PDF/X-1a,而非 PDF/X-1。这是两个不同的东西,虽然目前没有人使用 PDF/X-1,但最好使用标准的正确名称,其中包括 "a".

PDF/X-3 和 RGB
原始问题 "instead of leaving them in RGB (which should be the case with PDF/X-3)" 中的陈述不正确或至少具有误导性(尽管我认为意图是正确的)。

PDF/X-1a和PDF/X-3的区别确实是PDF/X-3支持CMYK以外的颜色空间。但这并不意味着不允许使用 CMYK,或者您不能完美地将 PDF/X-3 用于仅使用 CMYK 的文件。事实上,据我所知,大多数使用 "PDF/X-3" 的实现只是简单地使用 CMYK 文件。

是的,如果您有一个仅包含 CMYK and/or 专色的 PDF/X-3 文件,并且您将标准元数据字段更改为 PDF/X-1a,您最终会得到一个有效的 PDF/X-1a 文件;这些标准之间几乎没有区别。