diff options
author | Paul Gardiner <paul@glidos.net> | 2012-06-20 15:22:00 +0100 |
---|---|---|
committer | Paul Gardiner <paul@glidos.net> | 2012-06-21 09:09:03 +0100 |
commit | eb30d47b93138b2ffdf95e9d35de7c072e852956 (patch) | |
tree | 16f49bf7ae6fbe93f6c1996e39966d84b383643c /pdf/pdf_annot.c | |
parent | 6884949a8d27c4fb9b8c03dfe1c930d1e74d1d95 (diff) | |
download | mupdf-eb30d47b93138b2ffdf95e9d35de7c072e852956.tar.xz |
Forms: permit annotations with no appearance stream
We now create pdf_annot objects for PDF annotations even if they have no
appearance stream (i.e. even if invisible). That is necessary because
even invisible annotations can be targets of user interaction.
This is at least a partial fix for bug 693131
Diffstat (limited to 'pdf/pdf_annot.c')
-rw-r--r-- | pdf/pdf_annot.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/pdf/pdf_annot.c b/pdf/pdf_annot.c index 2e66f8aa..5109ae45 100644 --- a/pdf/pdf_annot.c +++ b/pdf/pdf_annot.c @@ -356,7 +356,6 @@ pdf_load_annots(pdf_document *xref, pdf_obj *annots, fz_matrix page_ctm) { pdf_annot *annot, *head, *tail; pdf_obj *obj, *ap, *as, *n, *rect; - pdf_xobject *form; int i, len; fz_context *ctx = xref->ctx; @@ -394,36 +393,37 @@ pdf_load_annots(pdf_document *xref, pdf_obj *annots, fz_matrix page_ctm) if (!pdf_is_stream(xref, pdf_to_num(n), pdf_to_gen(n))) n = pdf_dict_get(n, as); + + annot = fz_malloc_struct(ctx, pdf_annot); + annot->obj = pdf_keep_obj(obj); + annot->rect = pdf_to_rect(ctx, rect); + annot->pagerect = fz_transform_rect(page_ctm, annot->rect); + annot->ap = NULL; + if (pdf_is_stream(xref, pdf_to_num(n), pdf_to_gen(n))) { fz_try(ctx) { - form = pdf_load_xobject(xref, n); + annot->ap = pdf_load_xobject(xref, n); + pdf_transform_annot(annot); } fz_catch(ctx) { fz_warn(ctx, "ignoring broken annotation"); - continue; } + } - annot = fz_malloc_struct(ctx, pdf_annot); - annot->obj = pdf_keep_obj(obj); - annot->rect = pdf_to_rect(ctx, rect); - annot->pagerect = fz_transform_rect(page_ctm, annot->rect); - annot->ap = form; - annot->next = NULL; + annot->next = NULL; - pdf_transform_annot(annot); - if (annot) + if (annot) + { + if (!head) + head = tail = annot; + else { - if (!head) - head = tail = annot; - else - { - tail->next = annot; - tail = annot; - } + tail->next = annot; + tail = annot; } } } |