diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2017-05-25 12:00:21 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2017-05-25 12:28:00 +0200 |
commit | 32599868df1b3ecd553a0c1bc3e2521dd11b288a (patch) | |
tree | 31ea9a6e6c42ed560e19f3d8b655d2f29286d786 /source/tools | |
parent | f01a11057f3352330bacd411160db1c2a032a1dc (diff) | |
download | mupdf-32599868df1b3ecd553a0c1bc3e2521dd11b288a.tar.xz |
Replace broken FZ_IGNORE_IMAGE hints with other mechanisms.
Add an option to the structured text device to preserve images.
If the PDF processor does not have ops to process images, then skip
loading them in the interpreter if possible. If the device does not
have any image callbacks, then don't set the image processing ops in
the run device.
This accomplishes the same effect as the device hints were intended
to do, but without needing to expose them to the PDF interpreter
which may not even have a device since we now have multiple PDF op
processors.
Diffstat (limited to 'source/tools')
-rw-r--r-- | source/tools/mudraw.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/tools/mudraw.c b/source/tools/mudraw.c index 086220ab..ef95f1d3 100644 --- a/source/tools/mudraw.c +++ b/source/tools/mudraw.c @@ -510,16 +510,16 @@ static void dodrawpage(fz_context *ctx, fz_page *page, fz_display_list *list, in fz_try(ctx) { fz_rect mediabox; + fz_stext_options stext_options; if (list) fz_bound_display_list(ctx, list, &mediabox); else fz_bound_page(ctx, page, &mediabox); + stext_options.flags = (output_format == OUT_HTML) ? FZ_STEXT_PRESERVE_IMAGES : 0; text = fz_new_stext_page(ctx, &mediabox); - dev = fz_new_stext_device(ctx, sheet, text, 0); + dev = fz_new_stext_device(ctx, sheet, text, &stext_options); if (lowmemory) fz_enable_device_hints(ctx, dev, FZ_NO_CACHE); - if (output_format == OUT_HTML) - fz_disable_device_hints(ctx, dev, FZ_IGNORE_IMAGE); if (list) fz_run_display_list(ctx, list, dev, &fz_identity, &fz_infinite_rect, cookie); else |