1

我在 centos 上转换我的 'pdf.pdf' 文件:

gs -sDEVICE=pdfwrite -dNOOUTERSAVE -dNOPAUSE -dBATCH -dPDFA=1 -dUseCIEColor -sProcessColorModel=DeviceCMYK -sOutputFile=out.pdf PDFA_def.ps pdf.pdf

我的 PDFA_def.ps 看起来是这样的:

[root@localhost Downloads]# cat PDFA_def.ps 
%!
% This is a sample prefix file for creating a PDF/A 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.

% Define entries in the document Info dictionary :

/ICCProfile (/usr/share/ghostscript/9.07/iccprofiles/default_cmyk.icc)
def

[ /Title (MyTitle)                  % Customize.
  /DOCINFO pdfmark

% Define an ICC profile :

[/_objdef {icc_PDFA} /type /stream /OBJ pdfmark
[{icc_PDFA} <</N systemdict /ProcessColorModel get /DeviceGray eq {1} {4} ifelse >> /PUT pdfmark
[{icc_PDFA} ICCProfile (r) file /PUT pdfmark

% Define the output intent dictionary :

[/_objdef {OutputIntent_PDFA} /type /dict /OBJ pdfmark
[{OutputIntent_PDFA} <<
  /Type /OutputIntent             % Must be so (the standard requires).
  /S /GTS_PDFA1                   % Must be so (the standard requires).
  /DestOutputProfile {icc_PDFA}            % Must be so (see above).
  /OutputConditionIdentifier (CGATS TR001)      % Customize
>> /PUT pdfmark
[{Catalog} <</OutputIntents [ {OutputIntent_PDFA} ]>> /PUT pdfmark

并得到错误:

[root@localhost Downloads]# gs -sDEVICE=pdfwrite -dNOOUTERSAVE -dNOPAUSE -dBATCH -dPDFA=1 -dUseCIEColor -sProcessColorModel=DeviceCMYK -sOutputFile=out.pdf PDFA_def.ps pdf.pdf
GPL Ghostscript 9.07 (2013-02-14)
Copyright (C) 2012 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Error: /undefinedfilename in --file--
Operand stack:
   --nostringval--   --nostringval--   (ISO Coated sb.icc)   (r)
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1884   1   3   %oparray_pop   1883   1   3   %oparray_pop   1867   1   3   %oparray_pop   1755   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--
Dictionary stack:
   --dict:1168/1684(ro)(G)--   --dict:0/20(G)--   --dict:78/200(L)--
Current allocation mode is local
Last OS error: No such file or directory
Current file position is 627
GPL Ghostscript 9.07: Unrecoverable error, exit code 1

你能帮助我吗?我只需要将 pdf 转换为 pdfa,目前没有一些元数据。

4

0 回答 0