diff options
author | Simon Bünzli <zeniko@gmail.com> | 2013-08-18 13:54:14 +0200 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2013-08-28 13:35:52 +0100 |
commit | 3cc28e9828a1ce1ba69955a68c7e71ef7cd5f0d4 (patch) | |
tree | 27a0cddf98370d2c0f7e6050bffbb97ad518fc50 /source | |
parent | 7c7af425fb8d0467f4550f7ccdfa102d11f0690a (diff) | |
download | mupdf-3cc28e9828a1ce1ba69955a68c7e71ef7cd5f0d4.tar.xz |
take /Version in /Root into account
Diffstat (limited to 'source')
-rw-r--r-- | source/pdf/pdf-xref.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c index 743cf452..97433fa3 100644 --- a/source/pdf/pdf-xref.c +++ b/source/pdf/pdf-xref.c @@ -1162,6 +1162,21 @@ pdf_init_document(pdf_document *doc) { fz_warn(ctx, "Ignoring Broken Optional Content"); } + + fz_try(ctx) + { + char *version_str; + obj = pdf_dict_getp(pdf_trailer(doc), "Root/Version"); + version_str = pdf_to_name(obj); + if (*version_str) + { + /* TODO: use fz_atof for parsing instead? */ + int version = atoi(version_str) * 10 + atoi(version_str + 2); + if (version > doc->version) + doc->version = version; + } + } + fz_catch(ctx) { } } void |