summaryrefslogtreecommitdiff
path: root/source/tools/mudraw.c
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2017-09-14 15:52:47 +0100
committerRobin Watts <robin.watts@artifex.com>2017-10-24 15:16:36 +0100
commitc40b136f4ecb78a481326a544b56eb7be251445c (patch)
tree6e161421439b8a9733be69135b35bb46731f4973 /source/tools/mudraw.c
parentfbdd9c7c1bda2081e49b82a3a0d9ca5cf7abe492 (diff)
downloadmupdf-c40b136f4ecb78a481326a544b56eb7be251445c.tar.xz
Fix overprinting simulation in RGB output with no spots.
Running Ghent_V5.0/GWG010_CMYK_OP_x3.pdf to PNG produces 'X' marks, where Acrobat does not. This is expected if overprint similation is turned off, but not if it is enabled. The file does not define a colorspace for the initial page, uses no transparency, and has no spots defined. Accordingly, when we clone the page fz_separation object, we end up with no object at all. The draw device therefore doesn't even attempt to do overprint simulation. We fix this by ensuring that we always have a non-NULL separation object. Possibly we should make fz_page_separations return a non-NULL, but empty object? Even with this change, running to PNG still does not give the required rendering. This is because PNGs use RGB, rather than CMYK, and overprint is disabled for non-subtractive spaces. We therefore adjust the code in push_group_for_separations that decides whether it can avoid pushing an extra group. If the basic pixmap is RGB, then we never skip the extra group.
Diffstat (limited to 'source/tools/mudraw.c')
-rw-r--r--source/tools/mudraw.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/tools/mudraw.c b/source/tools/mudraw.c
index 6382e95c..d3cef7a2 100644
--- a/source/tools/mudraw.c
+++ b/source/tools/mudraw.c
@@ -1042,6 +1042,13 @@ static void drawpage(fz_context *ctx, fz_document *doc, int pagenum)
for (i = 0; i < n; i++)
fz_set_separation_behavior(ctx, seps, i, FZ_SEPARATION_COMPOSITE);
}
+ else
+ {
+ /* If we are doing spot rendering (or overprint simulation)
+ * then we need (at least) an empty sep object to force the
+ * overprint simulation in the draw device. */
+ seps = fz_new_separations(ctx, 0);
+ }
}
fz_catch(ctx)
{