From 1e91bb1c4b55060809154ff7ba6f210f74499c4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20B=C3=BCnzli?= Date: Fri, 18 Jul 2014 15:16:06 +0200 Subject: Bug 695271: fix incremental updates for files without final linebreak PDF documents aren't required to end in a linebreak. Objects however must start on their own line (in particular for broken documents relying on reparation). For this reason, a linebreak must be inserted before starting an incremental update. --- source/pdf/pdf-write.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source') diff --git a/source/pdf/pdf-write.c b/source/pdf/pdf-write.c index 8fb4b03d..53761bc7 100644 --- a/source/pdf/pdf-write.c +++ b/source/pdf/pdf-write.c @@ -2588,7 +2588,10 @@ void pdf_write_document(pdf_document *doc, char *filename, fz_write_options *fz_ { opts.out = fopen(filename, "ab"); if (opts.out) + { fseek(opts.out, 0, SEEK_END); + fprintf(opts.out, "\n"); + } } else { -- cgit v1.2.3