I recently modified devn_get_params to return PageSpotColors since I needed that to get color_info.max_components set correctly (see bug 693557), but noticed that this function just returns dummy functions. In general, the goal is to be able put deviceparams and then read back the same ones with get. For reference, the code (with my modification for PageSpotColors) is: { int code; bool seprs = false; gs_param_string_array scna; gs_param_string_array sona; set_param_array(scna, NULL, 0); set_param_array(sona, NULL, 0); if ( (code = sample_device_crd_get_params(pdev, plist, "CRDDefault")) < 0 || (code = param_write_name_array(plist, "SeparationColorNames", &scna)) < 0 || (code = param_write_name_array(plist, "SeparationOrder", &sona)) < 0 || (code = param_write_bool(plist, "Separations", &seprs)) < 0 || (code = param_write_int(plist, "PageSpotColors", &(pdevn_params->page_spot_colors))) < 0) return code; return 0; } Unless I am missing something, this always returns empty arrays for the SeparationColorNames and SeparationOrder and always returns 'false' for Separations. Doesn't seem right to me.
Do we have a test file that has a CRD so that we can exercise this bit of code? I think since we have gone to a pure ICC workflow this bit of code could probably be removed.
This seems to work now. The following program /dump { % dict /key -> dict dup ==only ( ) =only 2 copy known { 2 copy get == pop }{(none)== } ifelse } bind def /params { currentpagedevice {/Separations/ProcessColorModel/SeparationColorNames/SeparationOrder /PageSpotColors/CRDDefault} //dump forall pop } bind def params << /SeparationColorNames [/Cyan/Magenta/Yellow/Black/Pink/Rainbow] /SeparationOrder 1 index /PageSpotColors 2 >> setpagedevice params showpage Prints ~/ghostpdl/debugbin/gs -q -sDEVICE=tiffsep -o a.tiff devn.ps /Separations false /ProcessColorModel /DeviceCMYK /SeparationColorNames [] /SeparationOrder [] /PageSpotColors -1 /CRDDefault (none) /Separations false /ProcessColorModel /DeviceCMYK /SeparationColorNames [/Cyan /Magenta /Yellow /Black /Pink /Rainbow] /SeparationOrder [/Cyan /Magenta /Yellow /Black /Pink /Rainbow] /PageSpotColors 2 /CRDDefault (none)
Closing as per Peter's comment #2