poppler/Page.cc | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
New commits: commit 653b8da5bd6e50303207a2e8ccb5f5ad67db3767 Author: Albert Astals Cid <[email protected]> Date: Thu Oct 14 23:33:13 2010 +0100 Only clip boxes to mediabox if we are at the page level Fixes bug 30784 diff --git a/poppler/Page.cc b/poppler/Page.cc index d52cb77..3e80605 100644 --- a/poppler/Page.cc +++ b/poppler/Page.cc @@ -15,7 +15,7 @@ // // Copyright (C) 2005 Kristian Høgsberg <[email protected]> // Copyright (C) 2005 Jeff Muizelaar <[email protected]> -// Copyright (C) 2005-2009 Albert Astals Cid <[email protected]> +// Copyright (C) 2005-2010 Albert Astals Cid <[email protected]> // Copyright (C) 2006-2008 Pino Toscano <[email protected]> // Copyright (C) 2006 Nickolay V. Shmyrev <[email protected]> // Copyright (C) 2006 Scott Turner <[email protected]> @@ -91,6 +91,7 @@ void PDFRectangle::clipTo(PDFRectangle *rect) { PageAttrs::PageAttrs(PageAttrs *attrs, Dict *dict) { Object obj1; PDFRectangle mBox; + const GBool isPage = dict->is("Page"); // get old/default values if (attrs) { @@ -124,8 +125,8 @@ PageAttrs::PageAttrs(PageAttrs *attrs, Dict *dict) { if (!haveCropBox) { cropBox = mediaBox; } - else - { + + if (isPage) { // cropBox can not be bigger than mediaBox if (cropBox.x2 - cropBox.x1 > mediaBox.x2 - mediaBox.x1) { @@ -147,11 +148,13 @@ PageAttrs::PageAttrs(PageAttrs *attrs, Dict *dict) { artBox = cropBox; readBox(dict, "ArtBox", &artBox); - // clip all other boxes to the media box - cropBox.clipTo(&mediaBox); - bleedBox.clipTo(&mediaBox); - trimBox.clipTo(&mediaBox); - artBox.clipTo(&mediaBox); + if (isPage) { + // clip all other boxes to the media box + cropBox.clipTo(&mediaBox); + bleedBox.clipTo(&mediaBox); + trimBox.clipTo(&mediaBox); + artBox.clipTo(&mediaBox); + } // rotate dict->lookup("Rotate", &obj1);
_______________________________________________ poppler mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/poppler
