summaryrefslogtreecommitdiff
path: root/include
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 /include
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 'include')
-rw-r--r--include/mupdf/fitz/document.h13
-rw-r--r--include/mupdf/pdf/object.h11
-rw-r--r--include/mupdf/pdf/page.h1
3 files changed, 23 insertions, 2 deletions
diff --git a/include/mupdf/fitz/document.h b/include/mupdf/fitz/document.h
index d3b9abd5..95e59632 100644
--- a/include/mupdf/fitz/document.h
+++ b/include/mupdf/fitz/document.h
@@ -178,6 +178,12 @@ typedef int (fz_page_separation_disabled_fn)(fz_context *ctx, fz_page *page, int
*/
typedef fz_separations *(fz_page_separations_fn)(fz_context *ctx, fz_page *page);
+/*
+ fz_page_uses_overprint_fn: Type for a function to retrieve
+ whether or not a given page uses overprint.
+*/
+typedef int (fz_page_uses_overprint_fn)(fz_context *ctx, fz_page *page);
+
typedef void (fz_annot_drop_fn)(fz_context *ctx, fz_annot *annot);
typedef fz_annot *(fz_annot_next_fn)(fz_context *ctx, fz_annot *annot);
typedef fz_rect *(fz_annot_bound_fn)(fz_context *ctx, fz_annot *annot, fz_rect *rect);
@@ -212,6 +218,7 @@ struct fz_page_s
fz_page_control_separation_fn *control_separation;
fz_page_separation_disabled_fn *separation_disabled;
fz_page_separations_fn *separations;
+ fz_page_uses_overprint_fn *overprint;
};
/*
@@ -610,6 +617,12 @@ fz_colorspace *fz_document_output_intent(fz_context *ctx, fz_document *doc);
fz_separations *fz_page_separations(fz_context *ctx, fz_page *page);
/*
+ fz_page_uses_overprint: Find out whether a given page requests
+ overprint.
+*/
+int fz_page_uses_overprint(fz_context *ctx, fz_page *page);
+
+/*
fz_save_gproof: Given a currently open document, create a
gproof skeleton file from that document.
diff --git a/include/mupdf/pdf/object.h b/include/mupdf/pdf/object.h
index 5ceab1f0..285acf4d 100644
--- a/include/mupdf/pdf/object.h
+++ b/include/mupdf/pdf/object.h
@@ -66,8 +66,15 @@ void pdf_unmark_obj(fz_context *ctx, pdf_obj *obj);
/* obj memo functions - allows us to secretly remember "a memo" (a bool) in
* an object, and to read back whether there was a memo, and if so, what it
* was. */
-void pdf_set_obj_memo(fz_context *ctx, pdf_obj *obj, int memo);
-int pdf_obj_memo(fz_context *ctx, pdf_obj *obj, int *memo);
+
+enum
+{
+ PDF_FLAGS_MEMO_BM = 0,
+ PDF_FLAGS_MEMO_OP = 1
+};
+
+void pdf_set_obj_memo(fz_context *ctx, pdf_obj *obj, int bit, int memo);
+int pdf_obj_memo(fz_context *ctx, pdf_obj *obj, int bit, int *memo);
/* obj dirty bit support. */
int pdf_obj_is_dirty(fz_context *ctx, pdf_obj *obj);
diff --git a/include/mupdf/pdf/page.h b/include/mupdf/pdf/page.h
index 13f61bfa..969aedf0 100644
--- a/include/mupdf/pdf/page.h
+++ b/include/mupdf/pdf/page.h
@@ -194,6 +194,7 @@ struct pdf_page_s
pdf_obj *obj;
int transparency;
+ int overprint;
int incomplete;
fz_link *links;