Process both widgets and annotations when rewriting images.
authorSebastian Rasmussen <[email protected]>
Fri, 22 Nov 2024 18:05:59 +0000 (19:05 +0100)
committerSebastian Rasmussen <[email protected]>
Fri, 24 Jan 2025 17:10:33 +0000 (18:10 +0100)
source/pdf/pdf-image-rewriter.c

index 7fbec57bcafab3eeb40290c0b01166d675a16511..ddf52a668602cfb68c6011b4e4ef08d147daafe5 100644 (file)
@@ -888,6 +888,8 @@ gather_image_info(fz_context *ctx, pdf_document *doc, int page_num, image_info *
 
                for (annot = pdf_first_annot(ctx, page); annot != NULL; annot = pdf_next_annot(ctx, annot))
                        pdf_filter_annot_contents(ctx, doc, annot, &options);
+               for (annot = pdf_first_widget(ctx, page); annot != NULL; annot = pdf_next_annot(ctx, annot))
+                       pdf_filter_annot_contents(ctx, doc, annot, &options);
        }
        fz_always(ctx)
                fz_drop_page(ctx, &page->super);
@@ -919,6 +921,8 @@ rewrite_image_info(fz_context *ctx, pdf_document *doc, int page_num, image_info
 
                for (annot = pdf_first_annot(ctx, page); annot != NULL; annot = pdf_next_annot(ctx, annot))
                        pdf_filter_annot_contents(ctx, doc, annot, &options);
+               for (annot = pdf_first_widget(ctx, page); annot != NULL; annot = pdf_next_annot(ctx, annot))
+                       pdf_filter_annot_contents(ctx, doc, annot, &options);
        }
        fz_always(ctx)
                fz_drop_page(ctx, &page->super);