gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-01 23:43:42 27 4
gpt4 key购买 nike

我已经为此苦苦挣扎了几天,所以我想我应该在这里寻求帮助......

基本上,我正在尝试使用 ps2pdf(版本 9.10)创建正确的 PDF/X-1 和 PDF/X-3 文档。是的,我知道 ps2pdf 据说只支持 PDF/X-3 (请参阅 this threadthis threadthis thread )。然而,由于 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 的 Preflight 运行该文件来确认这一点。

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

其次,为什么documentation说“不允许 RGB”与“-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

提前致谢!

最佳答案

首先,由于 PDF/X-1 中颜色支持的限制,您目前无法使用 pdfwrite 生成 PDF/X-1。现在实际上几乎可以做到,但是Separation和DeviceN颜色空间没有转换为设备空间,而且需要转换。

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

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

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

与 PDFX 一起设置 ColorConversionStrategy 没有任何效果,因为 PDFX 的颜色转换要求取代了命令行中的 ColorConversion。

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

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

关于pdf - 使用 ps2pdf (ghostscript) 创建正确的 PDF/X,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30434868/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com