diff options
Diffstat (limited to 'source/fitz/util.c')
-rw-r--r-- | source/fitz/util.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source/fitz/util.c b/source/fitz/util.c index cefac962..ff1464fc 100644 --- a/source/fitz/util.c +++ b/source/fitz/util.c @@ -269,8 +269,12 @@ fz_new_stext_page_from_display_list(fz_context *ctx, fz_display_list *list, fz_s { fz_stext_page *text; fz_device *dev; + fz_rect mediabox; - text = fz_new_stext_page(ctx); + if (list == NULL) + return NULL; + + text = fz_new_stext_page(ctx, fz_bound_display_list(ctx, list, &mediabox)); fz_try(ctx) { dev = fz_new_stext_device(ctx, sheet, text); @@ -295,8 +299,12 @@ fz_new_stext_page_from_page(fz_context *ctx, fz_page *page, fz_stext_sheet *shee { fz_stext_page *text; fz_device *dev; + fz_rect *mediabox; + + if (page == NULL) + return NULL; - text = fz_new_stext_page(ctx); + text = fz_new_stext_page(ctx, fz_bound_page(ctx, page, &mediabox)); fz_try(ctx) { dev = fz_new_stext_device(ctx, sheet, text); |