summaryrefslogtreecommitdiff
path: root/platform/ios/Classes/MuPageViewReflow.m
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2016-07-13 19:36:39 +0100
committerRobin Watts <robin.watts@artifex.com>2016-07-13 20:09:13 +0100
commitcaafb37ddf3d58f4d37d8c7b535021ff18d57861 (patch)
treef7d8352640c645266d78c1d72ffdb1a88109d30c /platform/ios/Classes/MuPageViewReflow.m
parented8501ed7f52ba96cbdf12594340e629ab99beef (diff)
downloadmupdf-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/MuPageViewReflow.m')
-rw-r--r--platform/ios/Classes/MuPageViewReflow.m3
1 files changed, 2 insertions, 1 deletions
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);