0

I have an application that generates a PDF with TCPDF and then uses Ghostscript to convert it to x3:2002 compatibility.

Using the command line, I call this command:

gs -dPDFX -dBATCH -dQUIET -dNOPAUSE -dNOOUTERSAVE -sProcessColorModel=DeviceCMYK -sColorConversionStrategy=CMYK -sColorConversionStrategyForImages=CMYK -sOutputICCProfile='ISO Coated sb.icc' -sDEVICE=pdfwrite -sOutputFile=$new_pdf $defs_file $original_pdf

This works well, except the colours are a bit washed out. What settings can I change to improve this?

An unrelated point, but if anyone has come across this and has an answer, it's worth pointing out: I also get errors for "Page boxes not nested properly".

Appreciate any help.

-- UPDATE --

I'm using version 9.15 and The PDFX_def.ps file is essentially the same as the sample provided:

%!
% $Id: PDFX_def.ps 8284 2007-10-10 17:40:38Z giles $
% 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 :

[ /GTS_PDFXVersion (PDF/X-3:2002) % Must be so (the standard requires).
  /Title (Generated by xxx.com) % 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

1 Answer 1

0

It depends on what the original colour space is in. You have specified CMYK as your output, and "ISO Coated sb.icc" as the output ICC profile.

So any colours not in CMYK will have to be converted into CMYK to start with. This is done using some default ICC profiles which will firstly convert all non-CMYK colours into ICC space, then using another default ICC profile to convert into CMYK.

You can change any of the ICC profiles involved in the conversion in order to get a different result. Take a look at the documentation in ghostpdl/gs/doc/GS9_Color_Management.pdf and /ghostpdl/gs/doc/Use.htm#ICC_color_parameters. Most likely if you drop the -sOutputICCProfeil you'll get something like what you want.

You haven't stated what the OutputIntentProfile is in your PDF/X defs file, and you haven't said what version of Ghostscript you are using, you'll want at least 9.14.

You haven't said where the page boxes not nested properly error is coming from.

2
  • Thanks Ken, I updated the question with the extra info. I left one running without the -sOutputICCProfile in the meantime and that is a little bit washed out, but a lot better. It also seems to have fixed the nested boxes problem, which seems unlikely. I'll run some more tests, but I think you may have cracked it. I'll come back and accept the answer if so!
    – Jammooka
    Sep 30, 2014 at 14:49
  • Err the nested boxes problem being fixed by an ICC profile seems unlikely, yes :-) You can, of course, use a different ICC profile to do the device-independent-colour to CMYK conversion. I'm not the colour expert though I'm afraid.
    – KenS
    Sep 30, 2014 at 15:44

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.