summaryrefslogtreecommitdiff
path: root/pdf/pdf_parse.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-05-14 19:34:35 +0100
committerRobin Watts <robin.watts@artifex.com>2012-05-31 13:26:00 +0100
commit65b8ae915465849babc1fa712971c701136f4ed5 (patch)
tree9724b5951eb266f7192c647d4fb26a127cd901fd /pdf/pdf_parse.c
parent97716e53a6fa6947a183ed88df54702f96ba97b5 (diff)
downloadmupdf-65b8ae915465849babc1fa712971c701136f4ed5.tar.xz
Add linearization to pdf_write function.
Extend mupdfclean to have a new -l file that writes the file linearized. This should still be considered experimental When writing a pdf file, analyse object use, flatten resource use, reorder the objects, generate a hintstream and output with linearisaton parameters. This is enough for Acrobat to accept the file as being optimised for Fast Web View. We ought to add more tables to the hintstream in some cases, but I doubt anyone actually uses it, the spec is so badly written. Certainly acrobat accepts the file as being optimised for 'Fast Web View'. Update fz_dict_put to allow for us adding a reference to the dictionary that is the sole owner of that reference already (i.e. don't drop then keep something that has a reference count of just 1). Update pdf_load_image_stream to use the stm_buf from the xref if there is one. Update pdf_close_document to discard any stm_bufs it may be holding. Update fz_dict_put to be pdf_dict_put - this was missed in a renaming ages ago and has been inconsistent since.
Diffstat (limited to 'pdf/pdf_parse.c')
-rw-r--r--pdf/pdf_parse.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pdf/pdf_parse.c b/pdf/pdf_parse.c
index b1472d1a..5018844c 100644
--- a/pdf/pdf_parse.c
+++ b/pdf/pdf_parse.c
@@ -370,7 +370,7 @@ pdf_parse_dict(pdf_document *xref, fz_stream *file, pdf_lexbuf *buf)
(tok == PDF_TOK_KEYWORD && !strcmp(buf->scratch, "ID")))
{
val = pdf_new_int(ctx, a);
- fz_dict_put(dict, key, val);
+ pdf_dict_put(dict, key, val);
pdf_drop_obj(val);
val = NULL;
pdf_drop_obj(key);
@@ -393,7 +393,7 @@ pdf_parse_dict(pdf_document *xref, fz_stream *file, pdf_lexbuf *buf)
fz_throw(ctx, "unknown token in dict");
}
- fz_dict_put(dict, key, val);
+ pdf_dict_put(dict, key, val);
pdf_drop_obj(val);
val = NULL;
pdf_drop_obj(key);