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 /source/tools | |
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 'source/tools')
-rw-r--r-- | source/tools/mudraw.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/tools/mudraw.c b/source/tools/mudraw.c index 16e12b6b..e7dc629b 100644 --- a/source/tools/mudraw.c +++ b/source/tools/mudraw.c @@ -620,7 +620,12 @@ static void dodrawpage(fz_context *ctx, fz_page *page, fz_display_list *list, in fz_try(ctx) { - text = fz_new_stext_page(ctx); + fz_rect mediabox; + if (list) + fz_bound_display_list(ctx, list, &mediabox); + else + fz_bound_page(ctx, page, &mediabox); + text = fz_new_stext_page(ctx, &mediabox); dev = fz_new_stext_device(ctx, sheet, text); if (lowmemory) fz_enable_device_hints(ctx, dev, FZ_NO_CACHE); |