diff options
-rw-r--r-- | include/mupdf/pdf/annot.h | 17 | ||||
-rw-r--r-- | include/mupdf/pdf/document.h | 4 | ||||
-rw-r--r-- | include/mupdf/pdf/page.h | 9 | ||||
-rw-r--r-- | platform/android/viewer/jni/mupdf.c | 34 | ||||
-rw-r--r-- | platform/gl/gl-main.c | 4 | ||||
-rw-r--r-- | platform/ios/Classes/MuPageViewNormal.m | 20 | ||||
-rw-r--r-- | platform/x11/pdfapp.c | 29 | ||||
-rw-r--r-- | source/pdf/pdf-annot-edit.c | 116 | ||||
-rw-r--r-- | source/pdf/pdf-annot.c | 3 | ||||
-rw-r--r-- | source/pdf/pdf-appearance.c | 51 | ||||
-rw-r--r-- | source/pdf/pdf-form.c | 61 | ||||
-rw-r--r-- | source/pdf/pdf-page.c | 9 |
12 files changed, 146 insertions, 211 deletions
diff --git a/include/mupdf/pdf/annot.h b/include/mupdf/pdf/annot.h index a7a83348..8aeae76c 100644 --- a/include/mupdf/pdf/annot.h +++ b/include/mupdf/pdf/annot.h @@ -93,8 +93,9 @@ struct pdf_annot_s pdf_xobject *ap; int ap_iteration; + int changed; + pdf_annot *next; - pdf_annot *next_changed; }; fz_link_dest pdf_parse_link_dest(fz_context *ctx, pdf_document *doc, fz_link_kind kind, pdf_obj *dest); @@ -107,8 +108,8 @@ pdf_obj *pdf_load_name_tree(fz_context *ctx, pdf_document *doc, pdf_obj *which); fz_link *pdf_load_link_annots(fz_context *ctx, pdf_document *, pdf_obj *annots, const fz_matrix *page_ctm); void pdf_annot_transform(fz_context *ctx, pdf_annot *annot, fz_matrix *annot_ctm); -void pdf_load_annots(fz_context *ctx, pdf_document *, pdf_page *page, pdf_obj *annots); -void pdf_update_annot(fz_context *ctx, pdf_document *, pdf_annot *annot); +void pdf_load_annots(fz_context *ctx, pdf_page *page, pdf_obj *annots); +void pdf_update_annot(fz_context *ctx, pdf_annot *annot); void pdf_drop_annots(fz_context *ctx, pdf_annot *annot_list); /* @@ -116,12 +117,12 @@ void pdf_drop_annots(fz_context *ctx, pdf_annot *annot_list); specified page. The returned pdf_annot structure is owned by the page and does not need to be freed. */ -pdf_annot *pdf_create_annot(fz_context *ctx, pdf_document *doc, pdf_page *page, fz_annot_type type); +pdf_annot *pdf_create_annot(fz_context *ctx, pdf_page *page, fz_annot_type type); /* pdf_delete_annot: delete an annotation */ -void pdf_delete_annot(fz_context *ctx, pdf_document *doc, pdf_page *page, pdf_annot *annot); +void pdf_delete_annot(fz_context *ctx, pdf_page *page, pdf_annot *annot); /* pdf_set_markup_annot_quadpoints: set the quadpoints for a text-markup annotation. @@ -171,12 +172,6 @@ pdf_obj *pdf_annot_irt(fz_context *ctx, pdf_annot *annot); void pdf_set_free_text_details(fz_context *ctx, pdf_document *doc, pdf_annot *annot, fz_point *pos, char *text, char *font_name, float font_size, float color[3]); /* - pdf_poll_changed_annot: enumerate the changed annotations recorded - by a call to pdf_update_page. -*/ -pdf_annot *pdf_poll_changed_annot(fz_context *ctx, pdf_document *idoc, pdf_page *page); - -/* pdf_new_annot: Internal function for creating a new pdf annotation. */ pdf_annot *pdf_new_annot(fz_context *ctx, pdf_page *page); diff --git a/include/mupdf/pdf/document.h b/include/mupdf/pdf/document.h index 0078c4a9..5b9632ff 100644 --- a/include/mupdf/pdf/document.h +++ b/include/mupdf/pdf/document.h @@ -140,7 +140,7 @@ struct pdf_ocg_descriptor_s are out of date, checks for cases where different appearance streams should be selected because of state changes, and records internally each annotation that has changed appearance. The list of changed annotations - is then available via pdf_poll_changed_annot. Note that a call to + is then available via querying the annot->changed flag. Note that a call to pdf_pass_event for one page may lead to changes on any other, so an app should call pdf_update_page for every page it currently displays. Also it is important that the pdf_page object is the one used to last render @@ -148,7 +148,7 @@ struct pdf_ocg_descriptor_s a call to pdf_update_page would not reliably be able to report all changed areas. */ -void pdf_update_page(fz_context *ctx, pdf_document *doc, pdf_page *page); +void pdf_update_page(fz_context *ctx, pdf_page *page); /* Determine whether changes have been made since the diff --git a/include/mupdf/pdf/page.h b/include/mupdf/pdf/page.h index e3efb1e7..a5a60be8 100644 --- a/include/mupdf/pdf/page.h +++ b/include/mupdf/pdf/page.h @@ -175,15 +175,10 @@ struct pdf_page_s pdf_obj *obj; int transparency; + int incomplete; fz_link *links; - pdf_annot *annots; - pdf_annot **annot_tailp; - pdf_annot *changed_annots; - pdf_annot *deleted_annots; - pdf_annot *tmp_annots; - - int incomplete; + pdf_annot *annots, **annot_tailp; }; enum diff --git a/platform/android/viewer/jni/mupdf.c b/platform/android/viewer/jni/mupdf.c index b682296c..96dc36df 100644 --- a/platform/android/viewer/jni/mupdf.c +++ b/platform/android/viewer/jni/mupdf.c @@ -669,21 +669,27 @@ JNI_FN(MuPDFCore_javascriptSupported)(JNIEnv *env, jobject thiz) static void update_changed_rects(globals *glo, page_cache *pc, pdf_document *idoc) { fz_context *ctx = glo->ctx; - fz_annot *annot; + pdf_page *ppage = (pdf_page*)pc->page; + pdf_annot *pannot; - pdf_update_page(ctx, idoc, (pdf_page *)pc->page); - while ((annot = (fz_annot *)pdf_poll_changed_annot(ctx, idoc, (pdf_page *)pc->page)) != NULL) + pdf_update_page(ctx, ppage); + for (pannot = pdf_first_annot(ctx, ppage); pannot; pannot = pdf_next_annot(ctx, pannot)) { - /* FIXME: We bound the annot twice here */ - rect_node *node = fz_malloc_struct(glo->ctx, rect_node); - fz_bound_annot(ctx, annot, &node->rect); - node->next = pc->changed_rects; - pc->changed_rects = node; - - node = fz_malloc_struct(glo->ctx, rect_node); - fz_bound_annot(ctx, annot, &node->rect); - node->next = pc->hq_changed_rects; - pc->hq_changed_rects = node; + if (pannot->changed) + { + fz_annot *annot = (fz_annot*)pannot; + + /* FIXME: We bound the annot twice here */ + rect_node *node = fz_malloc_struct(ctx, rect_node); + fz_bound_annot(ctx, annot, &node->rect); + node->next = pc->changed_rects; + pc->changed_rects = node; + + node = fz_malloc_struct(ctx, rect_node); + fz_bound_annot(ctx, annot, &node->rect); + node->next = pc->hq_changed_rects; + pc->hq_changed_rects = node; + } } } @@ -1740,7 +1746,7 @@ JNI_FN(MuPDFCore_deleteAnnotationInternal)(JNIEnv * env, jobject thiz, int annot if (annot) { - pdf_delete_annot(ctx, idoc, (pdf_page *)pc->page, (pdf_annot *)annot); + pdf_delete_annot(ctx, (pdf_page *)pc->page, (pdf_annot *)annot); dump_annotation_display_lists(glo); } } diff --git a/platform/gl/gl-main.c b/platform/gl/gl-main.c index 904f3f51..712e02aa 100644 --- a/platform/gl/gl-main.c +++ b/platform/gl/gl-main.c @@ -679,7 +679,7 @@ static void do_forms(float xofs, float yofs) { if (pdf->focus) ui.active = do_forms; - pdf_update_page(ctx, pdf, (pdf_page*)page); + pdf_update_page(ctx, (pdf_page*)page); render_page(); ui_needs_update = 1; } @@ -692,7 +692,7 @@ static void do_forms(float xofs, float yofs) event.event.pointer.ptype = PDF_POINTER_UP; if (pdf_pass_event(ctx, pdf, (pdf_page*)page, &event)) { - pdf_update_page(ctx, pdf, (pdf_page*)page); + pdf_update_page(ctx, (pdf_page*)page); render_page(); ui_needs_update = 1; } diff --git a/platform/ios/Classes/MuPageViewNormal.m b/platform/ios/Classes/MuPageViewNormal.m index 496b62ce..f5afdcee 100644 --- a/platform/ios/Classes/MuPageViewNormal.m +++ b/platform/ios/Classes/MuPageViewNormal.m @@ -504,19 +504,21 @@ static rect_list *updatePage(fz_document *doc, fz_page *page) fz_try(ctx) { pdf_document *idoc = pdf_specifics(ctx, doc); - if (idoc) { - fz_annot *annot; + pdf_page *page = (pdf_page*)page; + pdf_annot *pannot; - pdf_update_page(ctx, idoc, (pdf_page *)page); - while ((annot = (fz_annot *)pdf_poll_changed_annot(ctx, idoc, (pdf_page *)page)) != NULL) + pdf_update_page(ctx, (pdf_page *)page); + for (pannot = pdf_first_annot(ctx, ppage); pannot; pannot = pdf_next_annot(ctx, pannot)) { - rect_list *node = fz_malloc_struct(ctx, rect_list); - - fz_bound_annot(ctx, annot, &node->rect); - node->next = list; - list = node; + if (pannot->changed) + { + rect_list *node = fz_malloc_struct(ctx, rect_list); + fz_bound_annot(ctx, (fz_annot*)pannot, &node->rect); + node->next = list; + list = node; + } } } } diff --git a/platform/x11/pdfapp.c b/platform/x11/pdfapp.c index a7e9ebea..0b81d37f 100644 --- a/platform/x11/pdfapp.c +++ b/platform/x11/pdfapp.c @@ -786,26 +786,29 @@ static void pdfapp_runpage(pdfapp_t *app, fz_device *dev, const fz_matrix *ctm, static void pdfapp_updatepage(pdfapp_t *app) { - pdf_document *idoc = pdf_specifics(app->ctx, app->doc); fz_device *idev; fz_matrix ctm; - fz_annot *annot; + pdf_annot *pannot; pdfapp_viewctm(&ctm, app); - pdf_update_page(app->ctx, idoc, (pdf_page *)app->page); + pdf_update_page(app->ctx, (pdf_page *)app->page); pdfapp_recreate_annotationslist(app); - while ((annot = (fz_annot *)pdf_poll_changed_annot(app->ctx, idoc, (pdf_page *)app->page)) != NULL) + for (pannot = pdf_first_annot(app->ctx, (pdf_page*)app->page); pannot; pannot = pdf_next_annot(app->ctx, pannot)) { - fz_rect bounds; - fz_irect ibounds; - fz_transform_rect(fz_bound_annot(app->ctx, annot, &bounds), &ctm); - fz_rect_from_irect(&bounds, fz_round_rect(&ibounds, &bounds)); - fz_clear_pixmap_rect_with_value(app->ctx, app->image, 255, &ibounds); - idev = fz_new_draw_device_with_bbox(app->ctx, NULL, app->image, &ibounds); - pdfapp_runpage(app, idev, &ctm, &bounds, NULL); - fz_close_device(app->ctx, idev); - fz_drop_device(app->ctx, idev); + if (pannot->changed) + { + fz_annot *annot = (fz_annot*)pannot; + fz_rect bounds; + fz_irect ibounds; + fz_transform_rect(fz_bound_annot(app->ctx, annot, &bounds), &ctm); + fz_rect_from_irect(&bounds, fz_round_rect(&ibounds, &bounds)); + fz_clear_pixmap_rect_with_value(app->ctx, app->image, 255, &ibounds); + idev = fz_new_draw_device_with_bbox(app->ctx, NULL, app->image, &ibounds); + pdfapp_runpage(app, idev, &ctm, &bounds, NULL); + fz_close_device(app->ctx, idev); + fz_drop_device(app->ctx, idev); + } } pdfapp_showpage(app, 0, 0, 1, 0, 0); diff --git a/source/pdf/pdf-annot-edit.c b/source/pdf/pdf-annot-edit.c index 32c3f353..63a05e1c 100644 --- a/source/pdf/pdf-annot-edit.c +++ b/source/pdf/pdf-annot-edit.c @@ -35,60 +35,11 @@ static const char *annot_type_str(fz_annot_type type) } } -void -pdf_update_annot(fz_context *ctx, pdf_document *doc, pdf_annot *annot) -{ - pdf_obj *obj, *ap, *as, *n; - - if (doc->update_appearance) - doc->update_appearance(ctx, doc, annot); - - obj = annot->obj; - - ap = pdf_dict_get(ctx, obj, PDF_NAME_AP); - as = pdf_dict_get(ctx, obj, PDF_NAME_AS); - - if (pdf_is_dict(ctx, ap)) - { - pdf_hotspot *hp = &doc->hotspot; - - n = NULL; - - if (hp->num == pdf_to_num(ctx, obj) && (hp->state & HOTSPOT_POINTER_DOWN)) - { - n = pdf_dict_get(ctx, ap, PDF_NAME_D); /* down state */ - } - - if (n == NULL) - n = pdf_dict_get(ctx, ap, PDF_NAME_N); /* normal state */ - - /* lookup current state in sub-dictionary */ - if (!pdf_is_stream(ctx, n)) - n = pdf_dict_get(ctx, n, as); - - pdf_drop_xobject(ctx, annot->ap); - annot->ap = NULL; - - if (pdf_is_stream(ctx, n)) - { - fz_try(ctx) - { - annot->ap = pdf_load_xobject(ctx, doc, n); - annot->ap_iteration = annot->ap->iteration; - } - fz_catch(ctx) - { - fz_rethrow_if(ctx, FZ_ERROR_TRYLATER); - fz_warn(ctx, "ignoring broken annotation"); - } - } - } -} - pdf_annot * -pdf_create_annot(fz_context *ctx, pdf_document *doc, pdf_page *page, fz_annot_type type) +pdf_create_annot(fz_context *ctx, pdf_page *page, fz_annot_type type) { pdf_annot *annot = NULL; + pdf_document *doc = page->doc; pdf_obj *annot_obj = pdf_new_dict(ctx, doc, 0); pdf_obj *ind_obj = NULL; @@ -153,11 +104,12 @@ pdf_create_annot(fz_context *ctx, pdf_document *doc, pdf_page *page, fz_annot_ty } void -pdf_delete_annot(fz_context *ctx, pdf_document *doc, pdf_page *page, pdf_annot *annot) +pdf_delete_annot(fz_context *ctx, pdf_page *page, pdf_annot *annot) { + pdf_document *doc = annot->page->doc; pdf_annot **annotptr; - pdf_obj *old_annot_arr; pdf_obj *annot_arr; + int i; if (annot == NULL) return; @@ -174,55 +126,35 @@ pdf_delete_annot(fz_context *ctx, pdf_document *doc, pdf_page *page, pdf_annot * return; *annotptr = annot->next; + /* If the removed annotation was the last in the list adjust the end pointer */ if (*annotptr == NULL) page->annot_tailp = annotptr; - /* Stick it in the deleted list */ - annot->next = page->deleted_annots; - page->deleted_annots = annot; - - pdf_drop_xobject(ctx, annot->ap); - annot->ap = NULL; - - /* Recreate the "Annots" array with this annot removed */ - old_annot_arr = pdf_dict_get(ctx, page->obj, PDF_NAME_Annots); - - if (old_annot_arr) + /* If the removed annotation has the focus, blur it. */ + if (doc->focus == annot) { - int i, n = pdf_array_len(ctx, old_annot_arr); - annot_arr = pdf_new_array(ctx, doc, n?(n-1):0); + doc->focus = NULL; + doc->focus_obj = NULL; + } - fz_try(ctx) - { - for (i = 0; i < n; i++) - { - pdf_obj *obj = pdf_array_get(ctx, old_annot_arr, i); + /* Remove the annot from the "Annots" array. */ + annot_arr = pdf_dict_get(ctx, page->obj, PDF_NAME_Annots); + i = pdf_array_find(ctx, annot_arr, annot->obj); + if (i >= 0) + pdf_array_delete(ctx, annot_arr, i); - if (obj != annot->obj) - pdf_array_push(ctx, annot_arr, obj); - } + if (pdf_is_indirect(ctx, annot_arr)) + pdf_update_object(ctx, doc, pdf_to_num(ctx, annot_arr), annot_arr); + else + pdf_dict_put(ctx, page->obj, PDF_NAME_Annots, annot_arr); - if (pdf_is_indirect(ctx, old_annot_arr)) - pdf_update_object(ctx, doc, pdf_to_num(ctx, old_annot_arr), annot_arr); - else - pdf_dict_put(ctx, page->obj, PDF_NAME_Annots, annot_arr); + /* The garbage collection pass when saving will remove the annot object, + * removing it here may break files if multiple pages use the same annot. */ - if (pdf_is_indirect(ctx, annot->obj)) - pdf_delete_object(ctx, doc, pdf_to_num(ctx, annot->obj)); - } - fz_always(ctx) - { - pdf_drop_obj(ctx, annot_arr); - } - fz_catch(ctx) - { - fz_rethrow(ctx); - } - } + /* And free it. */ + fz_drop_annot(ctx, (fz_annot*)annot); - pdf_drop_obj(ctx, annot->obj); - annot->obj = NULL; doc->dirty = 1; } diff --git a/source/pdf/pdf-annot.c b/source/pdf/pdf-annot.c index d1ca7de0..ae6bd907 100644 --- a/source/pdf/pdf-annot.c +++ b/source/pdf/pdf-annot.c @@ -502,8 +502,9 @@ pdf_annot *pdf_new_annot(fz_context *ctx, pdf_page *page) } void -pdf_load_annots(fz_context *ctx, pdf_document *doc, pdf_page *page, pdf_obj *annots) +pdf_load_annots(fz_context *ctx, pdf_page *page, pdf_obj *annots) { + pdf_document *doc = page->doc; pdf_annot *annot, **itr; pdf_obj *obj, *ap, *as, *n; int i, len, keep_annot; diff --git a/source/pdf/pdf-appearance.c b/source/pdf/pdf-appearance.c index f22c97c8..5982ca88 100644 --- a/source/pdf/pdf-appearance.c +++ b/source/pdf/pdf-appearance.c @@ -2527,3 +2527,54 @@ void pdf_update_appearance(fz_context *ctx, pdf_document *doc, pdf_annot *annot) pdf_clean_obj(ctx, obj); } } + +void +pdf_update_annot(fz_context *ctx, pdf_annot *annot) +{ + pdf_document *doc = annot->page->doc; + pdf_obj *obj, *ap, *as, *n; + + if (doc->update_appearance) + doc->update_appearance(ctx, doc, annot); + + obj = annot->obj; + + ap = pdf_dict_get(ctx, obj, PDF_NAME_AP); + as = pdf_dict_get(ctx, obj, PDF_NAME_AS); + + if (pdf_is_dict(ctx, ap)) + { + pdf_hotspot *hp = &doc->hotspot; + + n = NULL; + + if (hp->num == pdf_to_num(ctx, obj) && (hp->state & HOTSPOT_POINTER_DOWN)) + { + n = pdf_dict_get(ctx, ap, PDF_NAME_D); /* down state */ + } + + if (n == NULL) + n = pdf_dict_get(ctx, ap, PDF_NAME_N); /* normal state */ + + /* lookup current state in sub-dictionary */ + if (!pdf_is_stream(ctx, n)) + n = pdf_dict_get(ctx, n, as); + + pdf_drop_xobject(ctx, annot->ap); + annot->ap = NULL; + + if (pdf_is_stream(ctx, n)) + { + fz_try(ctx) + { + annot->ap = pdf_load_xobject(ctx, doc, n); + annot->ap_iteration = annot->ap->iteration; + } + fz_catch(ctx) + { + fz_rethrow_if(ctx, FZ_ERROR_TRYLATER); + fz_warn(ctx, "ignoring broken annotation"); + } + } + } +} diff --git a/source/pdf/pdf-form.c b/source/pdf/pdf-form.c index 045e1b86..9dc40f30 100644 --- a/source/pdf/pdf-form.c +++ b/source/pdf/pdf-form.c @@ -667,24 +667,15 @@ int pdf_pass_event(fz_context *ctx, pdf_document *doc, pdf_page *page, pdf_ui_ev return changed; } -void pdf_update_page(fz_context *ctx, pdf_document *doc, pdf_page *page) +void pdf_update_page(fz_context *ctx, pdf_page *page) { pdf_annot *annot; /* Reset changed_annots to empty */ - page->changed_annots = NULL; - - /* - Free all annots in tmp_annots, since these were - referenced only from changed_annots. - */ - if (page->tmp_annots) - { - pdf_drop_annots(ctx, page->tmp_annots); - page->tmp_annots = NULL; - } + for (annot = page->annots; annot; annot = annot->next) + annot->changed = 0; - /* Add all changed annots to the list */ + /* Flag all changed annots */ for (annot = page->annots; annot; annot = annot->next) { pdf_xobject *ap = pdf_keep_xobject(ctx, annot->ap); @@ -692,51 +683,15 @@ void pdf_update_page(fz_context *ctx, pdf_document *doc, pdf_page *page) fz_try(ctx) { - pdf_update_annot(ctx, doc, annot); - + pdf_update_annot(ctx, annot); if ((ap != annot->ap || ap_iteration != annot->ap_iteration)) - { - annot->next_changed = page->changed_annots; - page->changed_annots = annot; - } + annot->changed = 1; } fz_always(ctx) - { pdf_drop_xobject(ctx, ap); - } fz_catch(ctx) - { fz_rethrow(ctx); - } } - - /* - Add all deleted annots to the list, since these also - warrant a screen update - */ - for (annot = page->deleted_annots; annot; annot = annot->next) - { - annot->next_changed = page->changed_annots; - page->changed_annots = annot; - } - - /* - Move deleted_annots to tmp_annots to keep them separate - from any future deleted ones. They cannot yet be freed - since they are linked into changed_annots - */ - page->tmp_annots = page->deleted_annots; - page->deleted_annots = NULL; -} - -pdf_annot *pdf_poll_changed_annot(fz_context *ctx, pdf_document *idoc, pdf_page *page) -{ - pdf_annot *annot = page->changed_annots; - - if (annot) - page->changed_annots = annot->next_changed; - - return annot; } pdf_widget *pdf_focused_widget(fz_context *ctx, pdf_document *doc) @@ -771,7 +726,7 @@ pdf_widget *pdf_create_widget(fz_context *ctx, pdf_document *doc, pdf_page *page { pdf_obj *form = NULL; int old_sigflags = pdf_to_int(ctx, pdf_dict_getp(ctx, pdf_trailer(ctx, doc), "Root/AcroForm/SigFlags")); - pdf_annot *annot = pdf_create_annot(ctx, doc, page, PDF_ANNOT_WIDGET); + pdf_annot *annot = pdf_create_annot(ctx, page, PDF_ANNOT_WIDGET); fz_try(ctx) { @@ -799,7 +754,7 @@ pdf_widget *pdf_create_widget(fz_context *ctx, pdf_document *doc, pdf_page *page } fz_catch(ctx) { - pdf_delete_annot(ctx, doc, page, annot); + pdf_delete_annot(ctx, page, annot); /* An empty Fields array may have been created, but that is harmless */ diff --git a/source/pdf/pdf-page.c b/source/pdf/pdf-page.c index dae0d49d..73d01480 100644 --- a/source/pdf/pdf-page.c +++ b/source/pdf/pdf-page.c @@ -511,10 +511,7 @@ pdf_drop_page_imp(fz_context *ctx, pdf_page *page) fz_drop_link(ctx, page->links); if (page->annots) pdf_drop_annots(ctx, page->annots); - if (page->deleted_annots) - pdf_drop_annots(ctx, page->deleted_annots); - if (page->tmp_annots) - pdf_drop_annots(ctx, page->tmp_annots); + /* doc->focus, when not NULL, refers to one of * the annotations and must be NULLed when the * annotations are destroyed. doc->focus_obj @@ -551,8 +548,6 @@ pdf_new_page(fz_context *ctx, pdf_document *doc) page->links = NULL; page->annots = NULL; page->annot_tailp = &page->annots; - page->deleted_annots = NULL; - page->tmp_annots = NULL; page->incomplete = 0; return page; @@ -587,7 +582,7 @@ pdf_load_page(fz_context *ctx, pdf_document *doc, int number) fz_matrix page_ctm; pdf_page_transform(ctx, page, &page_mediabox, &page_ctm); page->links = pdf_load_link_annots(ctx, doc, obj, &page_ctm); - pdf_load_annots(ctx, doc, page, obj); + pdf_load_annots(ctx, page, obj); } } fz_catch(ctx) |