Ghostscript 目前可以将 PDF 转换为 PDF/X 吗?

Can Ghostscript currently convert a PDF to PDF/X?

印刷厂要求我的论文 PDF 符合 PDF/X1a:2001。内容文件是使用 XeTeX LaTeX 编译的,第二个 PDF 是使用 Inkscape 0.48 完成的封面设计。

我在这个 post 中找到的最接近的答案:, and if I rightly understood, this can be done at least to convert the PDF to PDF/X using Ghostscript

如上面的回答所述,转换为 PDF/X 需要有效的 ICC 配置文件。我联系了印刷厂,他们提供了一份他们喜欢的文件:ISOcoated_v2_300_eci.icc。我将 .icc 文件添加到目标 pdf 文件的同一文件夹中(感谢 VadimR 的评论)。

Ghostscript
我从命令行使用了这个脚本,但它不起作用:

gswin32c -dPDFX -dBATCH -dNOPAUSE -dNOOUTERSAVE -sProcessColorModel=DeviceCMYK -sDEVICE=pdfwrite -sOutputFile=outputfile.pdf PDFX_def.ps doctorate.pdf  

我花了一些时间做了 220 页,但效果很糟糕,效果不佳。

PDFX_def.ps的内容:

%!
% 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 (ISOcoated_v2_300_eci.icc) def  % Customize or remove.
%/ICCProfile (ISO Coated sb.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 (CGATS TR001)      % 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 文件,但不能生成 PDF/X1 我记得 PDF/X-1 要求所有颜色都以 CMYK 或灰色指定,而旧版本的 pdfwrite 不能' t 这样做,当前版本可以,但需要一些其他工作才能使其与 PDF/X-1 兼容,我不确定它是否值得付出努力。

看到这个bug report