diff --git a/include/mupdf/pdf/name-table.h b/include/mupdf/pdf/name-table.h index 78a621b74c..475a6deea4 100644 --- a/include/mupdf/pdf/name-table.h +++ b/include/mupdf/pdf/name-table.h @@ -373,6 +373,7 @@ PDF_MAKE_NAME("N", N) PDF_MAKE_NAME("Name", Name) PDF_MAKE_NAME("Named", Named) PDF_MAKE_NAME("Names", Names) +PDF_MAKE_NAME("NeedAppearances", NeedAppearances) PDF_MAKE_NAME("NewWindow", NewWindow) PDF_MAKE_NAME("Next", Next) PDF_MAKE_NAME("NextPage", NextPage) diff --git a/source/pdf/pdf-appearance.c b/source/pdf/pdf-appearance.c index 50ec40910d..80fafb8731 100644 --- a/source/pdf/pdf-appearance.c +++ b/source/pdf/pdf-appearance.c @@ -3699,6 +3699,13 @@ static void pdf_update_appearance(fz_context *ctx, pdf_annot *annot) local_synthesis = 1; } + /* Need to reconstruct appearance streams on all widgets if NeedAppearances is true */ + if (subtype == PDF_NAME(Widget)) + { + if (ap_n && pdf_to_bool(ctx, pdf_dict_getl(ctx, pdf_trailer(ctx, annot->page->doc), PDF_NAME(Root), PDF_NAME(AcroForm), PDF_NAME(NeedAppearances), NULL))) + local_synthesis = 1; + } + /* We need to put this appearance stream back into the document. */ needs_resynth = pdf_annot_needs_resynthesis(ctx, annot); if (needs_resynth)