summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@hotmail.com>2010-12-22 11:43:33 +0000
committerSebastian Rasmussen <sebras@hotmail.com>2010-12-22 11:43:33 +0000
commit6b935a6c9c2a2fa7a0fd4fdd6919ea7965fa4942 (patch)
treec99b11f2961ce5b4fd5eb773d7fbb17ae4225cf0
parent710be0599f68a309f34e57799379827d8d91c3af (diff)
downloadmupdf-6b935a6c9c2a2fa7a0fd4fdd6919ea7965fa4942.tar.xz
Fall back to Letter if page bounds are missing.
-rw-r--r--mupdf/pdf_page.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/mupdf/pdf_page.c b/mupdf/pdf_page.c
index eed1526b..e09cafb0 100644
--- a/mupdf/pdf_page.c
+++ b/mupdf/pdf_page.c
@@ -174,9 +174,15 @@ pdf_loadpage(pdf_page **pagep, pdf_xref *xref, fz_obj *dict)
page->annots = nil;
obj = fz_dictgets(dict, "MediaBox");
- if (!fz_isarray(obj))
- return fz_throw("cannot find page bounds (%d %d R)", fz_tonum(dict), fz_togen(dict));
bbox = fz_roundrect(pdf_torect(obj));
+ if (fz_isemptyrect(pdf_torect(obj)))
+ {
+ fz_warn("cannot find page bounds, guessing page bounds.");
+ bbox.x0 = 0;
+ bbox.y0 = 0;
+ bbox.x1 = 612;
+ bbox.y1 = 792;
+ }
obj = fz_dictgets(dict, "CropBox");
if (fz_isarray(obj))