summaryrefslogtreecommitdiff
path: root/source/html
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2014-11-17 13:52:03 +0100
committerTor Andersson <tor.andersson@artifex.com>2014-12-03 12:25:52 +0100
commit1af9460e3fe591b228870045fe150b61b495a5c4 (patch)
treee1aa4be4552483d048e53a920c7722096544050f /source/html
parentbceb717f5d088f440a8046acf2e1d8f0169fdab3 (diff)
downloadmupdf-1af9460e3fe591b228870045fe150b61b495a5c4.tar.xz
html: Pick a reasonable default page size.
Diffstat (limited to 'source/html')
-rw-r--r--source/html/handler.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/html/handler.c b/source/html/handler.c
index c3f9c3df..cbce9409 100644
--- a/source/html/handler.c
+++ b/source/html/handler.c
@@ -1,5 +1,8 @@
#include "mupdf/html.h"
+#define DEFW (450)
+#define DEFH (600)
+
void
html_close_document(html_document *doc)
{
@@ -12,7 +15,7 @@ html_count_pages(html_document *doc)
{
int count;
- if (!doc->box) html_layout_document(doc, 400, 400);
+ if (!doc->box) html_layout_document(doc, DEFW, DEFH);
count = ceilf(doc->box->h / doc->page_h);
printf("count pages! %g / %g = %d\n", doc->box->h, doc->page_h, count);
@@ -23,7 +26,7 @@ html_page *
html_load_page(html_document *doc, int number)
{
printf("load page %d\n", number);
- if (!doc->box) html_layout_document(doc, 400, 400);
+ if (!doc->box) html_layout_document(doc, DEFW, DEFH);
return (void*)((intptr_t)number + 1);
}
@@ -35,7 +38,7 @@ html_free_page(html_document *doc, html_page *page)
fz_rect *
html_bound_page(html_document *doc, html_page *page, fz_rect *bbox)
{
- if (!doc->box) html_layout_document(doc, 400, 400);
+ if (!doc->box) html_layout_document(doc, DEFW, DEFH);
printf("html: bound page\n");
bbox->x0 = bbox->y0 = 0;
bbox->x1 = doc->page_w;