Ghostscript目前可以将PDF转换为PDF / X吗? [英] Can Ghostscript currently convert a PDF to PDF/X?

查看:368
本文介绍了Ghostscript目前可以将PDF转换为PDF / X吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



我在这篇文章中找到的最近的答案: http:// stackoverflow。 com / a / 3483801/1288722 ,如果我正确地理解,这可以做到至少使用 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 的内容:

 %! 
%这是一个用于创建PDF / X-3文档的示例前缀文件。
%随意修改标记为自定义的条目。

%假设ICC配置文件驻留在文件(ISO Coated sb.icc)中,
%,除非用户修改以下相应的行。

systemdict / ProcessColorModel已知{
systemdict / ProcessColorModel get dup / DeviceGray ne exch / DeviceCMYK ne和
} {
true
} ifelse
{(ERROR:ProcessColorModel必须是/ DeviceGray或DeviceCMYK。)=
/ ProcessColorModel cvx / rangecheck signalerror
}如果

%定义文档的条目信息字典:

/ ICCProfile(ISOcoated_v2_300_eci.icc)def%自定义或删除。
%/ ICCProfile(ISO Coated sb.icc)def%自定义或删除。

[/ GTS_PDFXVersion(PDF / X-3:2002)%必须是(标准要求)。
/标题(标题)%自定义。
/ Trapped / False%必须这样(Ghostscript不提供其他)。
/ DOCINFO pdfmark

%定义ICC配置文件:

currentdict / ICCProfile已知{
[/ _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
}如果

%定义输出意图字典:

[ _objdef {OutputIntent_PDFX} / type / dict / OBJ pdfmark
[{OutputIntent_PDFX}<
/ Type / OutputIntent%必须是(标准要求)。
/ S / GTS_PDFX%必须是(标准要求)。
/ OutputCondition(商业和特殊打印)%自定义
/信息(无)%自定义
/ OutputConditionIdentifier(CGATS TR001)%自定义
/ RegistryName(http: color.org)%必须是(标准要求)。
currentdict / ICCProfile已知{
/ DestOutputProfile {icc_PDFX}%必须这样(见上文)。
} if
>> / PUT pdfmark
[{Catalog}<< / OutputIntents [{OutputIntent_PDFX}]> / PUT pdfmark

那么我失踪了什么?



笔记




  • Windows 7 32位

  • 您可以生成PDF / X文件,但不能生成PDF / X1文件

解决方案召回PDF / X-1需要在CMYK或灰色中指定所有颜色,而旧版本的pdfwrite不能做到,但当前版本可以,但需要一些其他工作使其与PDF / X-1兼容,



查看此错误报告


The print house requires my dissertation's PDF to be compliant with PDF/X1a:2001. The content file was compiled using XeTeX LaTeX and the second PDF is the cover design done with Inkscape 0.48.

The nearest answer I found in this post: http://stackoverflow.com/a/3483801/1288722, and if I rightly understood, this can be done at least to convert the PDF to PDF/X using Ghostscript.

As stated in the answer above, conversion to PDF/X requires a valid ICC profile. I contacted the printing house and they provided a file of their preferred one which is: ISOcoated_v2_300_eci.icc. I added the .icc file to same folder of the target pdf files (thanks to VadimR for this remark).

Ghostscript
I used this script from command line but it didn't work:

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

I took some time to do 220 pages but it was awful, undesirable effect.

Contents of the 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

So what am I missing?

Notes

  • Windows 7 32bit
  • No commercial programs are desired

解决方案

You can produce PDF/X files, but not PDF/X1 As I recall PDF/X-1 requires all colours to be specified in CMYK or Gray and older versions of pdfwrite couldn't do that, the current version can, but needs some other work to make it compatible with PDF/X-1, I'm not certain its worth the effort.

See this bug report

这篇关于Ghostscript目前可以将PDF转换为PDF / X吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆