summaryrefslogtreecommitdiff
path: root/xps
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 /xps
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 'xps')
-rw-r--r--xps/xpspage.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/xps/xpspage.c b/xps/xpspage.c
index dafd76ed5..6237b7a33 100644
--- a/xps/xpspage.c
+++ b/xps/xpspage.c
@@ -125,6 +125,7 @@ xps_parse_fixed_page(xps_context_t *ctx, xps_part_t *part)
char base_uri[1024];
char *s;
int code, code1, code2;
+ int page_spot_colors = 0;
if_debug1m('|', ctx->memory, "doc: parsing page %s\n", part->name);
@@ -205,9 +206,19 @@ xps_parse_fixed_page(xps_context_t *ctx, xps_part_t *part)
}
}
+ /* At some point we may want to add the pre-parse for named colors and n-channel
+ colors here. The XPS spec makes it optional to put the colorant names in the
+ ICC profile. So we would need some sort of fall back and we would need to know
+ if a name color that we encounter is one that we already encountered, which would get
+ very messy in terms of comparing ICC profiles. Especially for example, if
+ the same spot color was used individually AND in an n-channel color profile.
+ Since XPS usage is rare, and the demand for support of real spot color separation
+ non-existent, we will set the PageSpotColors to 0 at this point. */
+
+ code = param_write_int((gs_param_list *)&list, "PageSpotColors", &(page_spot_colors));
code1 = param_write_bool((gs_param_list *)&list, "PageUsesTransparency", &(ctx->has_transparency));
code2 = param_write_float_array((gs_param_list *)&list, ".MediaSize", &fa);
- if ( code1 >= 0 || code2 >= 0)
+ if ( code >= 0 || code1 >= 0 || code2 >= 0)
{
gs_c_param_list_read(&list);
code = gs_putdeviceparams(dev, (gs_param_list *)&list);