summaryrefslogtreecommitdiff
path: root/gpdl
diff options
context:
space:
mode:
authorMichael Vrhel <michael.vrhel@artifex.com>2021-11-03 19:57:15 -0700
committerMichael Vrhel <michael.vrhel@artifex.com>2021-11-05 11:34:45 -0700
commitc40db67210e981537efdd33d8445c29f16e4f491 (patch)
tree0262ff2aac3b410f25e1321860b4169852e03bb7 /gpdl
parent86154fe0b961c1cf996c06626bba4a2be07e0cb9 (diff)
downloadghostpdl-c40db67210e981537efdd33d8445c29f16e4f491.tar.gz
Fix for setting of PageSpotColors Bug 704660
plmain.c should not be setting the PageSpotColors value. This should be set by the individual interpreters on a per page basis. This change fixes a crash (Bug 704660) reduces the number of closing and opening times of the device with pdfi and pdfi renders more than 4 spots to the separation devices just fine. Also for gpdl with HEAD, the subsequent execution of a PS file following a PCL file did not properly reset the PageSpotColors to -1 as is required for PS files, resulting in improper output when going to a separation device. This commit includes a fix for that. Tested with command line gpdl -sDEVICE=psdcmyk -r72 -o ./myoutputs/pdl_input_%d.psd ./myinputs/owl.pcl ./myinputs/Ad_InDesign.ps ./myinputs/spots_multi_page.pdf ./myinputs/input.xps ./myinputs/deviceNImage.eps ./myinputs/DeviceN_20Colors.pdf ./myinputs/page_spots/Ad_InDesign.ps to verify that the number of spots was getting properly set with each interpreter and page (when applicable) change.
Diffstat (limited to 'gpdl')
-rw-r--r--gpdl/psitop.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gpdl/psitop.c b/gpdl/psitop.c
index 00cf1a1a3..367599abc 100644
--- a/gpdl/psitop.c
+++ b/gpdl/psitop.c
@@ -420,6 +420,31 @@ ps_impl_init_job(pl_interp_implementation_t *impl,
(void)code1;
}
+ /* Make sure the PageSpotColors is set to -1 for PS */
+ {
+ gs_c_param_list* params;
+ int page_spot_colors = -1;
+ int code2;
+
+ params = gs_c_param_list_alloc(psi->memory, "ps_impl_init_job");
+ if (params == NULL)
+ return_error(gs_error_VMerror);
+
+ gs_c_param_list_write(params, psi->memory);
+ gs_param_list_set_persistent_keys((gs_param_list*)params, false);
+
+ code2 = param_write_int((gs_param_list*)params, "PageSpotColors", &(page_spot_colors));
+ if (code2 < 0)
+ return code2;
+
+ gs_c_param_list_read(params);
+
+ code2 = psapi_set_device_param(psi->psapi_instance, (gs_param_list*)params);
+ if (code2 < 0)
+ return code2;
+
+ gs_c_param_list_release(params);
+ }
return code;
}