summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-object.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2017-09-21 14:10:33 +0100
committerRobin Watts <robin.watts@artifex.com>2017-10-24 15:16:36 +0100
commitabd4c0da5d50cc5b81e430dea3eaa01502370dad (patch)
tree86df6381b21acc05eba42c2b884068ad96e45110 /source/pdf/pdf-object.c
parenta1e696d27e0927855dd2e0d505afd571b0f37ed7 (diff)
downloadmupdf-abd4c0da5d50cc5b81e430dea3eaa01502370dad.tar.xz
Improved overprint (simulation) control.
First, we add an fz_page_overprint function to detect if a page uses overprint. Only PDF implements this currently (other formats all return false). PDF looks for '/OP true' in any ExtGState entry. We make Mutool check this. If it finds it, and spot rendering is not completely disabled, then it ensures that the separation object passed to the pixmap into which we draw is non NULL. This causes the draw device to do overprint simulation. We ensure that mutool draw defaults to having the spot rendering mode default to simulation in builds that support it. Finally, we ensure that if an output intent is set by the document, and spot rendering is not completely disabled, then we ensure the seps object is non NULL so that we render to a group in the specified output intent, and THEN convert down to the required colorspace for the output. This should make us match acrobats behaviour.
Diffstat (limited to 'source/pdf/pdf-object.c')
-rw-r--r--source/pdf/pdf-object.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/source/pdf/pdf-object.c b/source/pdf/pdf-object.c
index 2d60edf1..def683d0 100644
--- a/source/pdf/pdf-object.c
+++ b/source/pdf/pdf-object.c
@@ -28,9 +28,9 @@ enum
{
PDF_FLAGS_MARKED = 1,
PDF_FLAGS_SORTED = 2,
- PDF_FLAGS_MEMO = 4,
- PDF_FLAGS_MEMO_BOOL = 8,
- PDF_FLAGS_DIRTY = 16
+ PDF_FLAGS_DIRTY = 4,
+ PDF_FLAGS_MEMO_BASE = 8,
+ PDF_FLAGS_MEMO_BASE_BOOL = 16
};
struct pdf_obj_s
@@ -1643,26 +1643,28 @@ pdf_unmark_obj(fz_context *ctx, pdf_obj *obj)
}
void
-pdf_set_obj_memo(fz_context *ctx, pdf_obj *obj, int memo)
+pdf_set_obj_memo(fz_context *ctx, pdf_obj *obj, int bit, int memo)
{
if (obj < PDF_OBJ__LIMIT)
return;
- obj->flags |= PDF_FLAGS_MEMO;
+ bit <<= 1;
+ obj->flags |= PDF_FLAGS_MEMO_BASE << bit;
if (memo)
- obj->flags |= PDF_FLAGS_MEMO_BOOL;
+ obj->flags |= PDF_FLAGS_MEMO_BASE_BOOL << bit;
else
- obj->flags &= ~PDF_FLAGS_MEMO_BOOL;
+ obj->flags &= ~(PDF_FLAGS_MEMO_BASE_BOOL << bit);
}
int
-pdf_obj_memo(fz_context *ctx, pdf_obj *obj, int *memo)
+pdf_obj_memo(fz_context *ctx, pdf_obj *obj, int bit, int *memo)
{
if (obj < PDF_OBJ__LIMIT)
return 0;
- if (!(obj->flags & PDF_FLAGS_MEMO))
+ bit <<= 1;
+ if (!(obj->flags & (PDF_FLAGS_MEMO_BASE<<bit)))
return 0;
- *memo = !!(obj->flags & PDF_FLAGS_MEMO_BOOL);
+ *memo = !!(obj->flags & (PDF_FLAGS_MEMO_BASE_BOOL<<bit));
return 1;
}