summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-08-21 12:02:58 +0200
committerTor Andersson <tor.andersson@artifex.com>2018-08-21 13:18:00 +0200
commit470f5b143db1eb825592e64d6942e69569c03140 (patch)
tree3e097097166c88cdafdcd07325d4909ec16b2187
parentc3bce9091a8cd0c185cd0719bf579e064f8abf47 (diff)
downloadmupdf-470f5b143db1eb825592e64d6942e69569c03140.tar.xz
Handle form fields where the V is a name object.
-rw-r--r--source/pdf/pdf-field.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/pdf/pdf-field.c b/source/pdf/pdf-field.c
index cc5ebf40..c1a6194f 100644
--- a/source/pdf/pdf-field.c
+++ b/source/pdf/pdf-field.c
@@ -5,7 +5,10 @@
char *pdf_field_value(fz_context *ctx, pdf_document *doc, pdf_obj *field)
{
- return pdf_load_stream_or_string_as_utf8(ctx, pdf_dict_get_inheritable(ctx, field, PDF_NAME(V)));
+ pdf_obj *v = pdf_dict_get_inheritable(ctx, field, PDF_NAME(V));
+ if (pdf_is_name(ctx, v))
+ return fz_strdup(ctx, pdf_to_name(ctx, v));
+ return pdf_load_stream_or_string_as_utf8(ctx, v);
}
int pdf_get_field_flags(fz_context *ctx, pdf_document *doc, pdf_obj *obj)