summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-write.c
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2015-03-08 18:31:22 +0100
committerRobin Watts <robin.watts@artifex.com>2015-03-20 17:14:07 +0000
commitcef4820268f18f03c4407d3897abfde012e92204 (patch)
tree1d51dfd1a38a66a7dc4bc2e34e5fc5796c62734b /source/pdf/pdf-write.c
parent6c9dc1493cdf4ff11bc8f8f9fc0e26ee328fbaef (diff)
downloadmupdf-cef4820268f18f03c4407d3897abfde012e92204.tar.xz
Automatically update /Length and /Filter in pdf_update_stream.
Diffstat (limited to 'source/pdf/pdf-write.c')
-rw-r--r--source/pdf/pdf-write.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/source/pdf/pdf-write.c b/source/pdf/pdf-write.c
index f6886beb..ac97e6e4 100644
--- a/source/pdf/pdf-write.c
+++ b/source/pdf/pdf-write.c
@@ -2010,8 +2010,7 @@ static void writexrefstream(fz_context *ctx, pdf_document *doc, pdf_write_option
writexrefstreamsubsect(ctx, doc, opts, index, fzbuf, from, to);
}
- pdf_update_stream(ctx, doc, num, fzbuf);
- pdf_dict_puts_drop(ctx, dict, "Length", pdf_new_int(ctx, doc, fz_buffer_storage(ctx, fzbuf, NULL)));
+ pdf_update_stream(ctx, doc, dict, fzbuf, 0);
writeobject(ctx, doc, opts, num, 0, 0);
fprintf(opts->out, "startxref\n%d\n%%%%EOF\n", startxref);
@@ -2409,7 +2408,7 @@ make_hint_stream(fz_context *ctx, pdf_document *doc, pdf_write_options *opts)
fz_try(ctx)
{
make_page_offset_hints(ctx, doc, opts, buf);
- pdf_update_stream(ctx, doc, pdf_xref_len(ctx, doc)-1, buf);
+ pdf_update_stream(ctx, doc, pdf_load_object(ctx, doc, pdf_xref_len(ctx, doc)-1, 0), buf, 0); // XXX
opts->hintstream_len = buf->len;
fz_drop_buffer(ctx, buf);
}