On Thu, 2016-03-24, 13:26 +0000, Jaseem Ali K T wrote:
> Hi all
>
> While PoDoFo’s get function subtract the left and bottom values to give the
> actual
> height and width, PoDoFo set functions do not add them while setting the
> values.
Hi all,
> So if a page has value other than zero from for bottom, we would get less than
> expected value for height(width) after setting value.> Hope someone can fix
> this, and please let me know
I have now fixed this issue, the change is attached to this e-mail as a patch,
build-tested it (static & shared lib native) and kindly ask you (if a
committer):
Could you please review, test, apply and commit this to the public repository
(before feature freeze, if it's unacceptable during it)?
> Thanks and Regards
> Ali
Best regards, mabri
Index: src/doc/PdfPage.cpp
===================================================================
--- src/doc/PdfPage.cpp (revision 1747)
+++ src/doc/PdfPage.cpp (working copy)
@@ -445,7 +445,9 @@
// assign the value of the box from the array
if ( pObjMediaBox && pObjMediaBox->IsArray() )
{
- pObjMediaBox->GetArray()[2].SetNumber(newWidth);
+ // in PdfRect::FromArray(), the Left value is subtracted from Width
+ double dLeftMediaBox = pObjMediaBox->GetArray()[0].GetReal();
+ pObjMediaBox->GetArray()[2].SetReal( newWidth + dLeftMediaBox );
PdfObject* pObjCropBox;
@@ -454,13 +456,17 @@
if ( pObjCropBox && pObjCropBox->IsArray() )
{
- pObjCropBox->GetArray()[2].SetNumber(newWidth);
+ // in PdfRect::FromArray(), the Left value is subtracted from Width
+ double dLeftCropBox = pObjCropBox->GetArray()[0].GetReal();
+ pObjCropBox->GetArray()[2].SetReal( newWidth + dLeftCropBox );
return true;
- }else
+ }
+ else
{
return false;
}
- }else
+ }
+ else
{
return false;
}
@@ -477,7 +483,9 @@
// assign the value of the box from the array
if ( pObj && pObj->IsArray() )
{
- pObj->GetArray()[3].SetNumber(newHeight);
+ // in PdfRect::FromArray(), the Bottom value is subtracted from Height
+ double dBottom = pObj->GetArray()[1].GetReal();
+ pObj->GetArray()[3].SetReal( newHeight + dBottom );
PdfObject* pObjCropBox;
@@ -486,13 +494,17 @@
if ( pObjCropBox && pObjCropBox->IsArray() )
{
- pObjCropBox->GetArray()[3].SetNumber(newHeight);
+ // in PdfRect::FromArray(), the Bottom value is subtracted from Height
+ double dBottomCropBox = pObjCropBox->GetArray()[1].GetReal();
+ pObjCropBox->GetArray()[3].SetReal( newHeight + dBottomCropBox );
return true;
- }else
+ }
+ else
{
return false;
}
- }else
+ }
+ else
{
return false;
}
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users