My ultimate goal is to know the ink coverage (sDEVICE=ink_cov)of every separation in my PDF including spot color and cmyk. I am trying to pull these out as separate grey scale files so I can process them with ink_cov but every time I run my script I get --nostringval--. I have tried all sorts of combination for naming the channels but nothing works. Here is my script :
gswin64c -dBATCH -dNOPAUSE -sDEVICE=tiffsep -c -sOutputFile=C:\gsfiles\myseps.tiff "<< /SeparationColorNames [/Process Cyan /Process Magenta /Process Yellow /Process Black /myspotred] >> setpagedevice" myspotred.pdf
here is the result
Error: /undefinedfilename in (<< /SeparationColorNames [/Process Cyan /Process Magenta /Process Yellow /Process Black /myspotred] >> setpagedevice)
Operand stack:
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push
Dictionary stack:
--dict:738/1123(ro)(G)-- --dict:0/20(G)-- --dict:75/200(L)--
Current allocation mode is local
Last OS error: Invalid argument
GPL Ghostscript 9.52: Unrecoverable error, exit code 1
Here's the file in acrobat Acrobat view of separations
Thanks for any help
You don't need to mess with SeparationColorNames.
Even if you did, you need to specify /Cyan not Cyan. The PostScript world doesn't have a /Process key at all, that's NChannel, which is specific to PDF and not supported by PostScript.
You've put a -c in the wrong place (before -sOutputFile instead of before the actual PostScript). Fortunately that is then negated by -sOutputFile. However what that means is that your PostScript fragment is then not treated as PostScript (because that's what -c means and the -c is terminates by the -s). So that chunk of PostScript gets treated as a filename which is why you get an undefinedfilename error.
To get all the separations just do :
gswin64c -sDEVICE=tiffsep -o C:\gsfiles\myseps%d.tiff myspotred.pdf
If you really want to specify the Separation Names then this:
gswin64c -sDEVICE=tiffsep -o C:\gsfiles\myseps%d.tiff -c "<< /SeparationColorNames [/myspotred] >> setpagedevice" -f myspotred.pdf
should be sufficient, The Process colourants are given by the ProcessColorModel of the device, which in this case is CMYK. You don't enter the Process colourants in the SeparationColorNames array for the very good reason that they are not Separation colours.
Note (for general PostScript) that real physical devices may not permit you to change the colourants, they are read only. So you can retrieve them via a currentpagedevice, but setpagedevice may not be able to alter them.