0

I am trying to fix my pure black colored text problem in PDF conversion. I am able to convert my sRGB pdf to CMYK pdf but text colors are not kept in pure black. I already tried to use ghostscript: convert PDF into CMYK preserving pure Black for text trick but even I compiled "apple_..." files in my current directory, I always get :

gsicc_open_search(): Could not find ~/temp/AdobeCPs/CMYK/apple_to_jNP_neutrals.icc .

the command I am using:

gs -q -sDEVICE=pdfwrite -o sample.pdf -sColorConversionStrategy=CMYK -sSourceObjectICC=control.txt test.pdf

My output is :

 ./base/gsicc_manage.c:1088: gsicc_open_search(): Could not find Graphic_RGB apple_to_jNP_neutrals.icc    0   1   0
+ ./base/gsicc_manage.c:660: gsicc_set_srcgtag_struct(): setting of control.txt src obj color info failed
| ./base/gsicc_manage.c:2731: gs_setsrcgtagicc(): cannot find srctag file
While reading gs_lev2.ps:
Error: /unknownerror in --.setuserparams--
Operand stack:
   (gs_res.ps\000gs_typ42.ps\000gs_cidfn.ps\000gs_cidcm.ps\000gs_fntem.ps\000gs_cidtt.ps\000gs_cidfm.ps\000gs_cmap.ps\000gs_setpd.ps\000gs_fapi.ps\000gs_typ32.ps\000gs_frsd.ps\000gs_ll3.ps\000gs_mex_e.ps\000gs_mro_e.ps\000gs_pdf_e.ps\000gs_wan_e.ps\000pdf...)   (gs_lev2.ps)   --dict:31/31(G)--   --dict:1/1(G)--   --dict:1/1(G)--
Execution stack:
   %interp_exit   --nostringval--   --nostringval--   %loop_continue   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   --nostringval--   --nostringval--
Dictionary stack:
   --dict:798/1123(G)--   --dict:71/200(L)--   --dict:798/1123(G)--   --dict:133/251(G)--   --dict:21/25(L)--
Last OS error: No such file or directory
Current file position is 24631
Unrecoverable error: syntaxerror in --nostringval--
Operand stack:
    gs_res.psgs_typ42.psgs_cidfn.psgs_cidcm.psgs_fntem.psgs_cidtt.psgs_cidfm.psgs_cmap.psgs_setpd.psgs_fapi.psgs_typ32.psgs_frsd.psgs_ll3.psgs_mex_e.psgs_mro_e.psgs_pdf_e.psgs_wan_e.pspdf_ops.psgs_l2img.pspdf_rbld.pspdf_base.pspdf_draw.pspdf_font.pspdf_main.pspdf_sec.psgs_cff.psgs_mgl_e.psgs_ttf.psgs_icc.psgs_dps.psgs_dpnxt.psgs_epsf.psgs_pdfwr.ps  gs_lev2.ps  --nostringval--  --nostringval--  --nostringval--  false
Unrecoverable error: undefined in .uninstallpagedevice
Operand stack:
    gs_res.psgs_typ42.psgs_cidfn.psgs_cidcm.psgs_fntem.psgs_cidtt.psgs_cidfm.psgs_cmap.psgs_setpd.psgs_fapi.psgs_typ32.psgs_frsd.psgs_ll3.psgs_mex_e.psgs_mro_e.psgs_pdf_e.psgs_wan_e.pspdf_ops.psgs_l2img.pspdf_rbld.pspdf_base.pspdf_draw.pspdf_font.pspdf_main.pspdf_sec.psgs_cff.psgs_mgl_e.psgs_ttf.psgs_icc.psgs_dps.psgs_dpnxt.psgs_epsf.psgs_pdfwr.ps  gs_lev2.ps  --nostringval--  --nostringval--  --nostringval--  false

My control.txt file is :

Image_RGB   apple_to_jNP_photo.icc       0   1   0
Graphic_RGB apple_to_jNP_neutrals.icc    0   1   0
Text_RGB    apple_to_jNP_neutrals.icc    0   1   0

echo $GS_LIB
/usr/share/ghostscript/9.18/Resource

ls /usr/share/ghostscript/9.18/Resource
CIDFont  CIDFSubst  CMap  ColorSpace  Decoding  Encoding  Font  IdiomSet  Init  SubstCID

current directory :

~/temp/AdobeCPs/CMYK$ ls
AppleRGB.icc               CoatedGRACoL2006.icc         JapanColor2003WebCoated.icc  USWebCoatedSWOP.icc
apple_to_jNP_neutrals.icc  control.txt                  JapanWebCoated.icc           USWebUncoated.icc
apple_to_jNP_photo.icc     JapanColor2001Coated.icc     sample.pdf                   WebCoatedFOGRA28.icc
CoatedFOGRA27.icc          JapanColor2001Uncoated.icc   test.pdf                     WebCoatedSWOP2006Grade3.icc
CoatedFOGRA39.icc          JapanColor2002Newspaper.icc  UncoatedFOGRA29.icc          WebCoatedSWOP2006Grade5.icc

Could you help ?

hatirlatici
  • 1,598
  • 2
  • 13
  • 24

2 Answers2

1

Even though this is a quite old thread it seems not yet solved. I had the same error as mentioned above with blanks as separators in the control.txt instead of tabs (as mentioned in the Ghostscript version Color Management WhitePaper). Changing to tabs fixed the problem for me.

Andreas
  • 11
  • 1
0

Your command line and input file isn't relevant to the problem, the failure is during startup:

| ./base/gsicc_manage.c:2731: gs_setsrcgtagicc(): cannot find srctag file While reading gs_lev2.ps:

gs_lev2.ps is part of Ghostscript's startup code. That's all executed before you even get to the point of reading the command line options.

You haven't said which version of Ghostscript you are using, on which OS, or where you got it from, but it looks to me like you version is fundamentally broken.

I infer from your text that you are using version 9.18, that's 5 versions (2.5 years) out of date, the current version is 9.23. I'd suggest you get the vanilla Ghostscript source from the downloads page and compile that.

KenS
  • 30,202
  • 3
  • 34
  • 51
  • Thanks for your reply `~/Downloads » gs -v arikan@Proaegeans-MacBook-Pro GPL Ghostscript 9.22 (2017-10-04) Copyright (C) 2017 Artifex Software, Inc. All rights reserved.` OS : Mac OS high sierra 10.13. I've compiled it from source code I'll try your suggest and put the result here for vanila setup ... – hatirlatici Apr 28 '18 at 19:14
  • I've done what you've said (remove any Ghostscript installation and compile it from scratch) but it did not work (unfortunately). it still cannot find icc files: ./base/gsicc_manage.c:1172: gsicc_open_search(): Could not find Graphic_RGB apple_to_jNP_neutrals.icc 0 1 0 + ./base/gsicc_manage.c:683: gsicc_set_srcgtag_struct(): setting of control.txt src obj color info failed | ./base/gsicc_manage.c:2861: gs_setsrcgtagicc(): cannot find srctag file – hatirlatici Apr 28 '18 at 19:44
  • What happens if you just execute 'gs' ? You should get the interactive 'GS>' prompt, type quit to exit it. If that works then its the ICC profile. The most likely problem is that Ghostscript doesn't look in the current directory for ICC profiles, it looks in its own file system. So you may be able to solve it by putting a full pathspec in for the profile. If not then I'll need to look tomorrow, I'm on a laptop right now.... – KenS Apr 28 '18 at 20:59
  • If 'gs' alone works, then try setting -sICCProfilesDir= to the path with your ICC profiles. You can find the parameter documented in /ghostpdl/doc/Use.htm. – KenS Apr 29 '18 at 08:02