summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Sharp <ken.sharp@artifex.com>2022-03-14 10:54:18 +0000
committerKen Sharp <ken.sharp@artifex.com>2022-03-14 10:57:12 +0000
commit0a3c4a4967184c7c7233352e28fac1f4eb91a7e4 (patch)
tree1ffafbed358b33567262b10a07b97d5a8bab51b6
parentf4c73c9122ee4823c1aeecbc59af7d08cbe003ce (diff)
downloadghostpdl-0a3c4a4967184c7c7233352e28fac1f4eb91a7e4.tar.gz
pdfwrite - reorder operations to get gstate written correctly
Bug #705037 "Blend Mode lost on writing PDF file" The problem here was soft masks. pdf_update_alpha() deals with a change in soft mask in addition to writing the alpha values. But we were writing the Blend Mode without reference to the soft mask. By calling pdf_update_alpha() before we deal with the blend mode we will correctly handle soft masks (and any required alpha changes), and then end up with the blend mode correct as well. This shows one diff with the test file /tests_private/comparefiles/Bug690534.pdf The differences are very subtle but I think they are progressions.
-rw-r--r--devices/vector/gdevpdfg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/devices/vector/gdevpdfg.c b/devices/vector/gdevpdfg.c
index a955e457e..d61712b08 100644
--- a/devices/vector/gdevpdfg.c
+++ b/devices/vector/gdevpdfg.c
@@ -2942,6 +2942,9 @@ pdf_prepare_drawing(gx_device_pdf *pdev, const gs_gstate *pgs,
int bottom;
if (pdev->CompatibilityLevel >= 1.4) {
+ code = pdf_update_alpha(pdev, pgs, ppres, for_text);
+ if (code < 0)
+ return code;
if (pdev->state.blend_mode != pgs->blend_mode) {
static const char *const bm_names[] = { GS_BLEND_MODE_NAMES };
char buf[20];
@@ -2956,9 +2959,6 @@ pdf_prepare_drawing(gx_device_pdf *pdev, const gs_gstate *pgs,
return code;
pdev->state.blend_mode = pgs->blend_mode;
}
- code = pdf_update_alpha(pdev, pgs, ppres, for_text);
- if (code < 0)
- return code;
} else {
/*
* If the graphics state calls for any transparency functions,