summaryrefslogtreecommitdiff
path: root/android/jni
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2013-06-12 16:28:14 +0200
committerTor Andersson <tor.andersson@artifex.com>2013-06-12 16:28:14 +0200
commitb86aa63432a2436563bdcc398577ec4884883434 (patch)
tree749002e3de9d52943898a47f8c57d34c6a09b188 /android/jni
parentb975f1b82a061db61124d1cf0cd55ab60c22dc8e (diff)
downloadmupdf-b86aa63432a2436563bdcc398577ec4884883434.tar.xz
Support begin/end page calls in text extraction device.
Diffstat (limited to 'android/jni')
-rw-r--r--android/jni/mupdf.c16
1 files changed, 3 insertions, 13 deletions
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);