summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-interpret.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2014-03-19 19:04:50 +0000
committerRobin Watts <robin.watts@artifex.com>2014-03-19 19:04:50 +0000
commite4d36ce68e0467ac4702f717386934a44970f4e5 (patch)
tree758a9999434f03a4607d1f23e43d9a58828b6444 /source/pdf/pdf-interpret.c
parent441954b6fb378e3af72500653be5636c7ade29ee (diff)
downloadmupdf-e4d36ce68e0467ac4702f717386934a44970f4e5.tar.xz
Add routine to clean pdf content streams for pages.
New routine to filter the content streams for pages, xobjects, type3 charprocs, patterns etc. The filtered streams are guaranteed to be properly matched with q/Q's, and to not have changed the top level ctm. Additionally we remove (some) repeated settings of colors etc. This filtering can be extended to be smarter later. The idea of this is to both repair after editing, and to leave the streams in a form that can be easily appended to. This is preparatory to work on Bates numbering and Watermarking. Currently the streams produced are uncompressed.
Diffstat (limited to 'source/pdf/pdf-interpret.c')
-rw-r--r--source/pdf/pdf-interpret.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/pdf/pdf-interpret.c b/source/pdf/pdf-interpret.c
index 525d2ead..507bf0fa 100644
--- a/source/pdf/pdf-interpret.c
+++ b/source/pdf/pdf-interpret.c
@@ -606,7 +606,7 @@ pdf_process_contents_buffer(pdf_csi *csi, pdf_obj *rdb, fz_buffer *contents)
}
void
-pdf_process_page_contents(pdf_document *doc, pdf_page *page, const pdf_process *process, fz_cookie *cookie)
+pdf_process_stream_object(pdf_document *doc, pdf_obj *obj, const pdf_process *process, pdf_obj *res, fz_cookie *cookie)
{
fz_context *ctx = doc->ctx;
pdf_csi *csi;
@@ -614,7 +614,7 @@ pdf_process_page_contents(pdf_document *doc, pdf_page *page, const pdf_process *
csi = pdf_new_csi(doc, cookie, process);
fz_try(ctx)
{
- csi->process.processor->process_contents(csi, csi->process.state, page->resources, page->contents);
+ csi->process.processor->process_contents(csi, csi->process.state, res, obj);
}
fz_always(ctx)
{
@@ -622,7 +622,7 @@ pdf_process_page_contents(pdf_document *doc, pdf_page *page, const pdf_process *
}
fz_catch(ctx)
{
- fz_rethrow_message(ctx, "cannot parse page content stream");
+ fz_rethrow_message(ctx, "cannot parse content stream");
}
}