From b86aa63432a2436563bdcc398577ec4884883434 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 12 Jun 2013 16:28:14 +0200 Subject: Support begin/end page calls in text extraction device. --- android/jni/mupdf.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'android') diff --git a/android/jni/mupdf.c b/android/jni/mupdf.c index 8edc8c41..f436a65d 100644 --- a/android/jni/mupdf.c +++ b/android/jni/mupdf.c @@ -1104,17 +1104,13 @@ JNI_FN(MuPDFCore_searchPage)(JNIEnv * env, jobject thiz, jstring jtext) fz_try(ctx) { - fz_rect mbrect; - if (glo->hit_bbox == NULL) glo->hit_bbox = fz_malloc_array(ctx, MAX_SEARCH_HITS, sizeof(*glo->hit_bbox)); zoom = glo->resolution / 72; fz_scale(&ctm, zoom, zoom); - mbrect = pc->media_box; - fz_transform_rect(&mbrect, &ctm); sheet = fz_new_text_sheet(ctx); - text = fz_new_text_page(ctx, &mbrect); + text = fz_new_text_page(ctx); dev = fz_new_text_device(ctx, sheet, text); fz_run_page(doc, pc->page, dev, &ctm, NULL); fz_free_device(dev); @@ -1199,15 +1195,12 @@ JNI_FN(MuPDFCore_text)(JNIEnv * env, jobject thiz) fz_try(ctx) { - fz_rect mbrect; int b, l, s, c; zoom = glo->resolution / 72; fz_scale(&ctm, zoom, zoom); - mbrect = pc->media_box; - fz_transform_rect(&mbrect, &ctm); sheet = fz_new_text_sheet(ctx); - text = fz_new_text_page(ctx, &mbrect); + text = fz_new_text_page(ctx); dev = fz_new_text_device(ctx, sheet, text); fz_run_page(doc, pc->page, dev, &ctm, NULL); fz_free_device(dev); @@ -1309,14 +1302,11 @@ JNI_FN(MuPDFCore_textAsHtml)(JNIEnv * env, jobject thiz) fz_try(ctx) { - fz_rect mbrect; int b, l, s, c; ctm = fz_identity; - mbrect = pc->media_box; - fz_transform_rect(&mbrect, &ctm); sheet = fz_new_text_sheet(ctx); - text = fz_new_text_page(ctx, &mbrect); + text = fz_new_text_page(ctx); dev = fz_new_text_device(ctx, sheet, text); fz_run_page(doc, pc->page, dev, &ctm, NULL); fz_free_device(dev); -- cgit v1.2.3