summaryrefslogtreecommitdiff
path: root/source/pdf
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2017-06-02 08:36:39 -0700
committerRobin Watts <Robin.Watts@artifex.com>2017-06-03 06:29:26 -0700
commit565624dd5c042de4ddf95be251d4cd011e9460d0 (patch)
tree468d731a472fce42add1b55156560ebe996c5e50 /source/pdf
parent6f3972535746487bf552eab2fa0d0096b60aab19 (diff)
downloadmupdf-565624dd5c042de4ddf95be251d4cd011e9460d0.tar.xz
Add documentation for pdf_processors.
Expose pdf_new_output_processor. Remove pdf_document argument to pdf_new_filter_processor. It is only ever used when copying resources from the old resource dictionary to the new one, whereupon it must agree with the bound pdf_document in the old resource dictionary.
Diffstat (limited to 'source/pdf')
-rw-r--r--source/pdf/pdf-clean.c6
-rw-r--r--source/pdf/pdf-op-buffer.c2
-rw-r--r--source/pdf/pdf-op-filter.c6
3 files changed, 6 insertions, 8 deletions
diff --git a/source/pdf/pdf-clean.c b/source/pdf/pdf-clean.c
index f74a3359..b8fa96c7 100644
--- a/source/pdf/pdf-clean.c
+++ b/source/pdf/pdf-clean.c
@@ -32,7 +32,7 @@ pdf_clean_stream_object(fz_context *ctx, pdf_document *doc, pdf_obj *obj, pdf_ob
res = pdf_new_dict(ctx, doc, 1);
proc_buffer = pdf_new_buffer_processor(ctx, buffer, ascii);
- proc_filter = pdf_new_filter_processor(ctx, proc_buffer, doc, orig_res, res);
+ proc_filter = pdf_new_filter_processor(ctx, proc_buffer, orig_res, res);
pdf_process_contents(ctx, proc_filter, doc, orig_res, obj, cookie);
pdf_close_processor(ctx, proc_filter);
@@ -94,7 +94,7 @@ pdf_clean_type3(fz_context *ctx, pdf_document *doc, pdf_obj *obj, pdf_obj *orig_
fz_try(ctx)
{
proc_buffer = pdf_new_buffer_processor(ctx, buffer, ascii);
- proc_filter = pdf_new_filter_processor(ctx, proc_buffer, doc, orig_res, res);
+ proc_filter = pdf_new_filter_processor(ctx, proc_buffer, orig_res, res);
pdf_process_contents(ctx, proc_filter, doc, orig_res, val, cookie);
pdf_close_processor(ctx, proc_filter);
@@ -161,7 +161,7 @@ void pdf_clean_page_contents(fz_context *ctx, pdf_document *doc, pdf_page *page,
resources = pdf_page_resources(ctx, page);
proc_buffer = pdf_new_buffer_processor(ctx, buffer, ascii);
- proc_filter = pdf_new_filter_processor(ctx, proc_buffer, doc, resources, res);
+ proc_filter = pdf_new_filter_processor(ctx, proc_buffer, resources, res);
pdf_process_contents(ctx, proc_filter, doc, resources, contents, cookie);
pdf_close_processor(ctx, proc_filter);
diff --git a/source/pdf/pdf-op-buffer.c b/source/pdf/pdf-op-buffer.c
index 6ae7f8fc..d5585766 100644
--- a/source/pdf/pdf-op-buffer.c
+++ b/source/pdf/pdf-op-buffer.c
@@ -775,7 +775,7 @@ pdf_drop_output_processor(fz_context *ctx, pdf_processor *proc)
fz_drop_output(ctx, out);
}
-static pdf_processor *
+pdf_processor *
pdf_new_output_processor(fz_context *ctx, fz_output *out, int ahxencode)
{
pdf_output_processor *proc = pdf_new_processor(ctx, sizeof *proc);
diff --git a/source/pdf/pdf-op-filter.c b/source/pdf/pdf-op-filter.c
index 731cabf2..ad80d3cd 100644
--- a/source/pdf/pdf-op-filter.c
+++ b/source/pdf/pdf-op-filter.c
@@ -49,7 +49,6 @@ typedef struct pdf_filter_processor_s
pdf_processor super;
pdf_processor *chain;
filter_gstate *gstate;
- pdf_document *doc;
pdf_obj *old_rdb, *new_rdb;
} pdf_filter_processor;
@@ -68,7 +67,7 @@ copy_resource(fz_context *ctx, pdf_filter_processor *p, pdf_obj *key, const char
res = pdf_dict_get(ctx, p->new_rdb, key);
if (!res)
{
- res = pdf_new_dict(ctx, p->doc, 1);
+ res = pdf_new_dict(ctx, pdf_get_bound_document(ctx, p->new_rdb), 1);
pdf_dict_put_drop(ctx, p->new_rdb, key, res);
}
pdf_dict_putp(ctx, res, name, obj);
@@ -1123,7 +1122,7 @@ pdf_drop_filter_processor(fz_context *ctx, pdf_processor *proc)
}
pdf_processor *
-pdf_new_filter_processor(fz_context *ctx, pdf_processor *chain, pdf_document *doc, pdf_obj *old_rdb, pdf_obj *new_rdb)
+pdf_new_filter_processor(fz_context *ctx, pdf_processor *chain, pdf_obj *old_rdb, pdf_obj *new_rdb)
{
pdf_filter_processor *proc = pdf_new_processor(ctx, sizeof *proc);
{
@@ -1243,7 +1242,6 @@ pdf_new_filter_processor(fz_context *ctx, pdf_processor *chain, pdf_document *do
}
proc->chain = chain;
- proc->doc = doc;
proc->old_rdb = old_rdb;
proc->new_rdb = new_rdb;