Hi,

I recently came across some pdf files which define pages boxes using reference 
to array
objects. In this case PdfPage::GetPageBox() returns a zero width/height rect.

Here is a patch which fix this issue :


Index: PdfPage.cpp
===================================================================
--- PdfPage.cpp (revision 1222)
+++ PdfPage.cpp (working copy)
@@ -201,6 +201,12 @@

     // Take advantage of inherited values - walking up the tree if necessary
     pObj = GetInheritedKeyFromObject( inBox, m_pObject );
+
+    // Sometime page boxes are defined using reference objects
+    while ( pObj && pObj->IsReference() )
+    {
+        pObj = m_pObject->GetOwner()->GetObject( pObj->GetReference() );
+    }

     // assign the value of the box from the array
     if ( pObj && pObj->IsArray() )

Regards,

Jean Ghali



------------------------------------------------------------------------------
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to