On Fri, Jan 28, 2011 at 11:09:38AM +0100, Michal Hocko wrote:
> [Please do not top post]
> 
> On Thu, Jan 27, 2011 at 06:04:25PM -0500, PMA wrote:
> > Here we go:
> > 
> > Pages
> >     3,0
> >        Type
> >        Kids
> >           4,0
> >           Type
> >           MediaBox
> >              0 Int =       0
> >              1 Int =       0
> >              2 Int =   792
> >              3 Int = 1224
> >           ...
> >           Cropbox
> >              0 Int =       0
> >              1 Int =       0
> >              2 Int =   612
> >              3 Int =   792
> > 
> > Those are the values both before & after I edit.
> 
[...]
> The patch testing would be much more helpful because you could report
> this to the Debian bug tracking system and they will update the patch. 

But the patch doesn't apply and backporting is not so trivial due to
some rework in that area. I have backported it localy and tried on top
of the current Debia stable sources and it still did the same. So this
is something different.

So I have looked deeper into history and found the commit which fixes
it. The fix was introduced in 0.4.2.

Attached you will find the patch for the Debian stable version so push
it through their bug tracking system.

-- 
Michal Hocko
kernel: fillInheritedPageAttr has to initialize Cropbox to Mediabox

If Cropbox is not present in the page dictionary we have to initialize
to the Mediabox size because otherwise we could end up with just a
subset of the Media. I have overlooked this when I implemented the
thing.

This fixes the issue when a large document (bigger than A4) without
Cropbox specified explicitly ended smaller after any changes to the
page.
Index: pdfedit-0.4.1/src/kernel/cpage.cc
===================================================================
--- pdfedit-0.4.1.orig/src/kernel/cpage.cc	2011-01-28 14:56:39.000000000 +0100
+++ pdfedit-0.4.1/src/kernel/cpage.cc	2011-01-28 15:35:28.000000000 +0100
@@ -215,10 +215,10 @@ namespace {
 				if(!attrs.mediaBox.get())
 					attrs.mediaBox=IProperty::getSmartCObjectPtr<CArray>(getIPropertyFromRectangle(defaultRect));
 
-				// CropBox is optional and specification doesn't say anything about
-				// default value - we are using standard A4 format
+				// CropBox is optional and specification says that Cropbox should be
+				// initialized to the Mediabox size if not present
 				if(!attrs.cropBox.get())
-					attrs.cropBox=IProperty::getSmartCObjectPtr<CArray>(getIPropertyFromRectangle(defaultRect));
+					attrs.cropBox=attrs.mediaBox;
 				
 				// Rotate is optional and specification defines default value to 0
 				if(!attrs.rotate.get())
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Pdfedit-support mailing list
Pdfedit-support@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdfedit-support

Reply via email to