summaryrefslogtreecommitdiff
path: root/source/pdf
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2016-05-06 13:08:52 +0100
committerRobin Watts <robin.watts@artifex.com>2016-05-06 13:10:35 +0100
commitf24fd137b0dc7f79b9e7c42ead0d8921b52a58b8 (patch)
tree12aaf052776b9e29dbc4c7c086af4c6844e7acfd /source/pdf
parent694642bc7bb676d945b79ef3e742c2c05313df75 (diff)
downloadmupdf-f24fd137b0dc7f79b9e7c42ead0d8921b52a58b8.tar.xz
Mutool clean: Copy OCProperties when subsetting.
Otherwise files (such as bug696754.pdf) can go wrong.
Diffstat (limited to 'source/pdf')
-rw-r--r--source/pdf/pdf-clean-file.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/pdf/pdf-clean-file.c b/source/pdf/pdf-clean-file.c
index e4e4a435..2a80f0cc 100644
--- a/source/pdf/pdf-clean-file.c
+++ b/source/pdf/pdf-clean-file.c
@@ -175,6 +175,7 @@ static void retainpages(fz_context *ctx, globals *glo, int argc, char **argv)
int argidx = 0;
pdf_obj *names_list = NULL;
pdf_obj *outlines;
+ pdf_obj *ocproperties;
int pagecount;
int i;
int *page_object_nums;
@@ -185,12 +186,15 @@ static void retainpages(fz_context *ctx, globals *glo, int argc, char **argv)
pages = pdf_dict_get(ctx, oldroot, PDF_NAME_Pages);
olddests = pdf_load_name_tree(ctx, doc, PDF_NAME_Dests);
outlines = pdf_dict_get(ctx, oldroot, PDF_NAME_Outlines);
+ ocproperties = pdf_dict_get(ctx, oldroot, PDF_NAME_OCProperties);
root = pdf_new_dict(ctx, doc, 3);
pdf_dict_put(ctx, root, PDF_NAME_Type, pdf_dict_get(ctx, oldroot, PDF_NAME_Type));
pdf_dict_put(ctx, root, PDF_NAME_Pages, pdf_dict_get(ctx, oldroot, PDF_NAME_Pages));
if (outlines)
pdf_dict_put(ctx, root, PDF_NAME_Outlines, outlines);
+ if (ocproperties)
+ pdf_dict_put(ctx, root, PDF_NAME_OCProperties, ocproperties);
pdf_update_object(ctx, doc, pdf_to_num(ctx, oldroot), root);