diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2016-10-24 21:41:55 +0800 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2016-10-26 22:36:00 +0800 |
commit | e7875fcd16a80d880c33b49c9142bce1d870e9a0 (patch) | |
tree | dd2b940bdadb021059d4e1ef21ba70f5e66dee65 /source/tools | |
parent | 04760747563826024dabbfdee2f2ad3a38fa3bab (diff) | |
download | mupdf-e7875fcd16a80d880c33b49c9142bce1d870e9a0.tar.xz |
Introduce options for structured text.
Diffstat (limited to 'source/tools')
-rw-r--r-- | source/tools/muconvert.c | 1 | ||||
-rw-r--r-- | source/tools/murun.c | 12 |
2 files changed, 9 insertions, 4 deletions
diff --git a/source/tools/muconvert.c b/source/tools/muconvert.c index 13afee5d..a62a0dd3 100644 --- a/source/tools/muconvert.c +++ b/source/tools/muconvert.c @@ -44,6 +44,7 @@ static void usage(void) "\n" ); fputs(fz_draw_options_usage, stderr); + fputs(fz_stext_options_usage, stderr); fputs(fz_cbz_write_options_usage, stderr); fputs(fz_png_write_options_usage, stderr); #if FZ_ENABLE_PDF diff --git a/source/tools/murun.c b/source/tools/murun.c index 898ed456..fc887105 100644 --- a/source/tools/murun.c +++ b/source/tools/murun.c @@ -1734,15 +1734,17 @@ static void ffi_Page_toStructuredText(js_State *J) { fz_context *ctx = js_getcontext(J); fz_page *page = ffi_topage(J, 0); - int options = js_tointeger(J, 1); + const char *options = js_iscoercible(J, 1) ? js_tostring(J, 1) : NULL; fz_stext_sheet *sheet = NULL; + fz_stext_options so; fz_stext_page *text; fz_var(sheet); fz_try(ctx) { sheet = fz_new_stext_sheet(ctx); - text = fz_new_stext_page_from_page(ctx, page, sheet, options); + fz_parse_stext_options(ctx, &so, options); + text = fz_new_stext_page_from_page(ctx, page, sheet, &so); } fz_always(ctx) fz_drop_stext_sheet(ctx, sheet); @@ -2573,15 +2575,17 @@ static void ffi_DisplayList_toStructuredText(js_State *J) { fz_context *ctx = js_getcontext(J); fz_display_list *list = js_touserdata(J, 0, "fz_display_list"); - int options = js_tointeger(J, 1); + const char *options = js_iscoercible(J, 1) ? js_tostring(J, 1) : NULL; fz_stext_sheet *sheet = NULL; + fz_stext_options so; fz_stext_page *text; fz_var(sheet); fz_try(ctx) { sheet = fz_new_stext_sheet(ctx); - text = fz_new_stext_page_from_display_list(ctx, list, sheet, options); + fz_parse_stext_options(ctx, &so, options); + text = fz_new_stext_page_from_display_list(ctx, list, sheet, &so); } fz_always(ctx) fz_drop_stext_sheet(ctx, sheet); |