summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vrhel <michael.vrhel@artifex.com>2022-03-01 13:28:00 -0800
committerChris Liddell <chris.liddell@artifex.com>2022-03-02 08:53:46 +0000
commite288b9b0e62d71b58e4fc0971bf953560fd1b85a (patch)
tree8f2286fadd416453d15fac5ec278138268580770
parentc259d6a184fd3a5dd633f165da768f797b668c1f (diff)
downloadghostpdl-e288b9b0e62d71b58e4fc0971bf953560fd1b85a.tar.gz
* Fix mismatch of page group push and pop condition
Thanks to Ken for finding this. If we are pushing the pdf14 device we may be doing this if we are doing overprint simulation or if there is transparency. Only push the page group if we have Transparency on the page (there are files which may have a page group but never use transparency op_all.pdf is an example of one). Match the conditions for pushing and popping the page group. Here we only will push the group if one exists, we have transparency on the page and we need the pdf14 device (and the device push and group push were successful).
-rw-r--r--pdf/pdf_page.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pdf/pdf_page.c b/pdf/pdf_page.c
index 3a337ee44..f2389feac 100644
--- a/pdf/pdf_page.c
+++ b/pdf/pdf_page.c
@@ -805,7 +805,7 @@ int pdfi_page_render(pdf_context *ctx, uint64_t page_num, bool init_graphics)
/* We don't retain the PDF14 device */
code = gs_push_pdf14trans_device(ctx->pgs, false, false, trans_depth, ctx->page.num_spots);
if (code >= 0) {
- if (page_group_known) {
+ if (ctx->page.has_transparency && page_group_known) {
code = pdfi_trans_begin_page_group(ctx, page_dict, group_dict);
/* If setting the page group failed for some reason, abandon the page group,
* but continue with the page
@@ -833,7 +833,7 @@ int pdfi_page_render(pdf_context *ctx, uint64_t page_num, bool init_graphics)
code = pdfi_process_one_page(ctx, page_dict);
- if (ctx->page.has_transparency && page_group_known) {
+ if (need_pdf14 && ctx->page.has_transparency && page_group_known) {
code1 = pdfi_trans_end_group(ctx);
}