diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2016-11-15 16:10:03 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-11-16 12:09:20 +0100 |
commit | fa9cd67527ab9994fec917f0f88fc16abb9926a6 (patch) | |
tree | 9f533a52350e32b0d778c158fbb4eafbe0d0d12e /source/pdf | |
parent | 5ed7e6c29233874a68733cdf075260fe261caa40 (diff) | |
download | mupdf-fa9cd67527ab9994fec917f0f88fc16abb9926a6.tar.xz |
pdf: Add 'compressed/raw' flag to pdf_add_stream.
Also expose the argument to JS and JNI.
Diffstat (limited to 'source/pdf')
-rw-r--r-- | source/pdf/pdf-page.c | 2 | ||||
-rw-r--r-- | source/pdf/pdf-xref.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/source/pdf/pdf-page.c b/source/pdf/pdf-page.c index 3a26445c..2112040a 100644 --- a/source/pdf/pdf-page.c +++ b/source/pdf/pdf-page.c @@ -673,7 +673,7 @@ pdf_add_page(fz_context *ctx, pdf_document *doc, const fz_rect *mediabox, int ro pdf_dict_put_drop(ctx, page_obj, PDF_NAME_MediaBox, pdf_new_rect(ctx, doc, mediabox)); pdf_dict_put_drop(ctx, page_obj, PDF_NAME_Rotate, pdf_new_int(ctx, doc, rotate)); pdf_dict_put_drop(ctx, page_obj, PDF_NAME_Resources, pdf_add_object(ctx, doc, resources)); - pdf_dict_put_drop(ctx, page_obj, PDF_NAME_Contents, pdf_add_stream(ctx, doc, contents, NULL)); + pdf_dict_put_drop(ctx, page_obj, PDF_NAME_Contents, pdf_add_stream(ctx, doc, contents, NULL, 0)); } fz_catch(ctx) { diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c index df3c3254..ccbe4cf6 100644 --- a/source/pdf/pdf-xref.c +++ b/source/pdf/pdf-xref.c @@ -2624,7 +2624,7 @@ pdf_add_object_drop(fz_context *ctx, pdf_document *doc, pdf_obj *obj) } pdf_obj * -pdf_add_stream(fz_context *ctx, pdf_document *doc, fz_buffer *buf, pdf_obj *obj) +pdf_add_stream(fz_context *ctx, pdf_document *doc, fz_buffer *buf, pdf_obj *obj, int compressed) { pdf_obj *ind; if (!obj) @@ -2632,7 +2632,7 @@ pdf_add_stream(fz_context *ctx, pdf_document *doc, fz_buffer *buf, pdf_obj *obj) else ind = pdf_add_object(ctx, doc, obj); fz_try(ctx) - pdf_update_stream(ctx, doc, ind, buf, 0); + pdf_update_stream(ctx, doc, ind, buf, compressed); fz_catch(ctx) { pdf_drop_obj(ctx, ind); |