diff options
author | Robin Watts <robin.watts@artifex.com> | 2016-07-13 19:36:39 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2016-07-13 20:09:13 +0100 |
commit | caafb37ddf3d58f4d37d8c7b535021ff18d57861 (patch) | |
tree | f7d8352640c645266d78c1d72ffdb1a88109d30c /platform/ios/Classes | |
parent | ed8501ed7f52ba96cbdf12594340e629ab99beef (diff) | |
download | mupdf-caafb37ddf3d58f4d37d8c7b535021ff18d57861.tar.xz |
Bug 696699: Fix Text extraction mediabox information.
Since the removal of the begin_page device function, structured
text extraction has been unable to correctly establish the
mediabox for extracted pages.
Update the fz_new_stext_page call to take this mediabox
information. This is an API change, but hopefully most people
are calling fz_new_stext_page_from_page or
fz_new_stext_page_from_display_list which are updated here to
cope.
Update all the apps/tools to behave properly.
Diffstat (limited to 'platform/ios/Classes')
-rw-r--r-- | platform/ios/Classes/MuPageViewNormal.m | 3 | ||||
-rw-r--r-- | platform/ios/Classes/MuPageViewReflow.m | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/platform/ios/Classes/MuPageViewNormal.m b/platform/ios/Classes/MuPageViewNormal.m index b9da24e5..c56ad840 100644 --- a/platform/ios/Classes/MuPageViewNormal.m +++ b/platform/ios/Classes/MuPageViewNormal.m @@ -72,10 +72,11 @@ static NSArray *enumerateWords(fz_document *doc, fz_page *page) fz_try(ctx) { + fz_rect mediabox; int b, l, c; sheet = fz_new_stext_sheet(ctx); - text = fz_new_stext_page(ctx); + text = fz_new_stext_page(ctx, fz_bound_page(ctx, page, &mediabox)); dev = fz_new_stext_device(ctx, sheet, text); fz_run_page(ctx, page, dev, &fz_identity, NULL); fz_drop_device(ctx, dev); diff --git a/platform/ios/Classes/MuPageViewReflow.m b/platform/ios/Classes/MuPageViewReflow.m index 9378da61..86905b03 100644 --- a/platform/ios/Classes/MuPageViewReflow.m +++ b/platform/ios/Classes/MuPageViewReflow.m @@ -11,6 +11,7 @@ NSString *textAsHtml(fz_document *doc, int pageNum) fz_matrix ctm; fz_buffer *buf = NULL; fz_output *out = NULL; + fz_rect mediabox; fz_var(page); fz_var(sheet); @@ -23,7 +24,7 @@ NSString *textAsHtml(fz_document *doc, int pageNum) { ctm = fz_identity; sheet = fz_new_stext_sheet(ctx); - text = fz_new_stext_page(ctx); + text = fz_new_stext_page(ctx, fz_bound_page(ctx, page, &mediabox)); dev = fz_new_stext_device(ctx, sheet, text); page = fz_load_page(ctx, doc, pageNum); fz_run_page(ctx, page, dev, &ctm, NULL); |