diff options
author | Michael Vrhel <michael.vrhel@artifex.com> | 2021-11-03 19:57:15 -0700 |
---|---|---|
committer | Michael Vrhel <michael.vrhel@artifex.com> | 2021-11-05 11:34:45 -0700 |
commit | c40db67210e981537efdd33d8445c29f16e4f491 (patch) | |
tree | 0262ff2aac3b410f25e1321860b4169852e03bb7 /pcl | |
parent | 86154fe0b961c1cf996c06626bba4a2be07e0cb9 (diff) | |
download | ghostpdl-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 'pcl')
-rw-r--r-- | pcl/pcl/pcjob.c | 3 | ||||
-rw-r--r-- | pcl/pl/plmain.c | 13 | ||||
-rw-r--r-- | pcl/pxl/pxsessio.c | 8 |
3 files changed, 11 insertions, 13 deletions
diff --git a/pcl/pcl/pcjob.c b/pcl/pcl/pcjob.c index cf3f02ac5..da3e20249 100644 --- a/pcl/pcl/pcjob.c +++ b/pcl/pcl/pcjob.c @@ -367,6 +367,9 @@ pcjob_do_reset(pcl_state_t * pcs, pcl_reset_type_t type) code = put_param1_bool(pcs, "BindShortEdge", pcs->bind_short_edge); if (code < 0) return code; + code = put_param1_int(pcs, "PageSpotColors", 0); + if (code < 0) + return code; } if (type & (pcl_reset_initial ^ pcl_reset_cold)) diff --git a/pcl/pl/plmain.c b/pcl/pl/plmain.c index 71108c0e8..ae33903a8 100644 --- a/pcl/pl/plmain.c +++ b/pcl/pl/plmain.c @@ -2780,19 +2780,6 @@ help: arg = NULL; } out: - /* PCL does not support spot colors and XPS files with spot colors are very - rare (as in never found in the wild). Handling XPS spots for a separation - device will require a little work. To avoid issues at the current time, - we will do the following - */ - { - int num_spots = 0; - gs_c_param_list_write_more(params); - code = param_write_int((gs_param_list *)params, "PageSpotColors", &(num_spots)); - if (code < 0) - return code; - } - /* Do any last minute language specific device initialisation * (i.e. let gs_init.ps do its worst). */ code = pl_main_post_args_init(pmi); diff --git a/pcl/pxl/pxsessio.c b/pcl/pxl/pxsessio.c index ea00634f5..82b17f766 100644 --- a/pcl/pxl/pxsessio.c +++ b/pcl/pxl/pxsessio.c @@ -457,6 +457,7 @@ pxBeginPage(px_args_t * par, px_state_t * pxs) int iv; bool bv; int ecode = 0; + int page_spot_colors = 0; fa.data = fv; fa.persistent = false; @@ -468,6 +469,13 @@ pxBeginPage(px_args_t * par, px_state_t * pxs) if (ecode < 0) return ecode; + /* PXL never has spot colors on the page */ + gs_c_param_list_write(&list, mem); + ecode = param_write_int(plist, "PageSpotColors", &(page_spot_colors)); + ecode = px_put1(dev, &list, ecode); + if (ecode < 0) + return ecode; + gs_c_param_list_write(&list, mem); fv[0] = pxs->media_dims.x; fv[1] = pxs->media_dims.y; |