Jump to content

PDF/X-3 using Ghostscript on Windows

From tango.info wiki

Installation

  • C:\Program Files (x86)\gs\gs9.06\bin\gswin32c.exe
  • C:\Program Files (x86)\gs\gs9.06\lib\PDFX_def.ps
    • copy to C:\all\projects\pdf-x-3\PDFX_def.ps
    • OLD: /ICCProfile (ISO Coated sb.icc) def  % Customize or remove.
    • NEW: /ICCProfile (C:/Windows/System32/spool/drivers/color/ISOcoated_v2_300_eci.icc) def  % Customize or remove.

Testing

Try: http://meiradarocha.jor.br/news/2012/08/25/como-criar-um-documento-pdfx-3-com-o-ghostscript/

gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sColorConversionStrategy=CMYK -sOutputFile=doc_CMYK.pdf -dProcessColorModel=/DeviceCMYK -dCompatibilityLevel=1.4 doc.pdf

TEST-1

C:\Program Files (x86)\gs\gs9.06>bin\gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=pdfw
rite -sColorConversionStrategy=CMYK -sOutputFile=doc_CMYK.pdf -dProcessColorMode
l=/DeviceCMYK -dCompatibilityLevel=1.4 ti.pdf
GPL Ghostscript 9.06:
Unable to convert color space to CMYK, reverting strategy to LeaveColorUnchanged
.

RESULT: CMYK conversion not possible. The output during the test was created in the users directory.

TEST-2

  • create C:\all\projects\pdf-x-3\
  • copy gs9.06 to C:\all\projects\pdf-x-3\gs9.06
  • create C:\all\projects\pdf-x-3\gs9.06\test\
  • create C:\all\projects\pdf-x-3\gs9.06\input.pdf
  • change to: C:\all\projects\pdf-x-3\gs9.06>

TEST-2.1

bin\gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sColorConversionStrategy=CMYK -sOutputFile=test\2.1.pdf -dProcessColorModel=/DeviceCMYK -dCompatibilityLevel=1.4 test\input.pdf

GPL Ghostscript 9.06: Unable to convert color space to CMYK, reverting strategy to LeaveColorUnchanged.

TEST-2.2

  • modify: C:\all\projects\pdf-x-3\gs9.06\lib\PDFX_def.ps
/ICCProfile (ISO Coated sb.icc) def  % Customize or remove.
%/ICCProfile (ISOcoated_v2_300_eci.icc) def  % Customize or remove.
bin\gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sColorConversionStrategy=CMYK -sOutputFile=test\2.2.pdf -dProcessColorModel=/DeviceCMYK -dCompatibilityLevel=1.4 -f C:\all\projects\pdf-x-3\gs9.06\lib\PDFX_def.ps test\input.pdf

RESULT:

Error: /undefinedfilename in --file--
Operand stack:
  --nostringval--   --nostringval--   (ISO Coated sb.icc)   (r)

TEST-2.3

  • copy ICC file to C:\all\projects\pdf-x-3\gs9.06\lib\ISOcoated_v2_300_eci.icc
  • modify: C:\all\projects\pdf-x-3\gs9.06\lib\PDFX_def.ps
%/ICCProfile (ISO Coated sb.icc) def  % Customize or remove.
/ICCProfile (ISOcoated_v2_300_eci.icc) def  % Customize or remove.
bin\gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sColorConversionStrategy=CMYK -sOutputFile=test\2.3.pdf -dProcessColorModel=/DeviceCMYK -dCompatibilityLevel=1.4 -f C:\all\projects\pdf-x-3\gs9.06\lib\PDFX_def.ps test\input.pdf

RESULT:

Error: /undefinedfilename in --file--
Operand stack:
  --nostringval--   --nostringval--   (ISOcoated_v2_300_eci.icc)   (r)

TEST-2.4

  • use full path, modify: C:\all\projects\pdf-x-3\gs9.06\lib\PDFX_def.ps
%/ICCProfile (ISO Coated sb.icc) def  % Customize or remove.
/ICCProfile (C:\all\projects\pdf-x-3\gs9.06\lib\ISOcoated_v2_300_eci.icc) def  % Customize or remove.
bin\gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sColorConversionStrategy=CMYK -sOutputFile=test\2.4.pdf -dProcessColorModel=/DeviceCMYK -dCompatibilityLevel=1.4 -f C:\all\projects\pdf-x-3\gs9.06\lib\PDFX_def.ps test\input.pdf

RESULT

Error: /undefinedfilename in --file--
Operand stack:
  --nostringval--   --nostringval--   (C:allprojectspdf-x-3gs9.06libISOcoated_v2_300_eci.icc)   (r)

TEST-2.5

  • use forward slashes, modify: C:\all\projects\pdf-x-3\gs9.06\lib\PDFX_def.ps
/ICCProfile (C:/all/projects/pdf-x-3/gs9.06/lib/ISOcoated_v2_300_eci.icc) def  % Customize or remove.
bin\gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sColorConversionStrategy=CMYK -sOutputFile=test\2.5.pdf -dProcessColorModel=/DeviceCMYK -dCompatibilityLevel=1.4 -f C:\all\projects\pdf-x-3\gs9.06\lib\PDFX_def.ps test\input.pdf

RESULT: Unable to convert color space to CMYK, reverting strategy to LeaveColorUnchanged.