Hi Enric,

Actually you are right. It is a design flaw in PoDoFo. We should use
PdfObject::GetIndirectKey everywhere instead of the PdfDictionary
methods. GetIndirectKey will resolve indirect references for you.

Maybe someone is willing to provide a patch for this?

Kindest regards,
 Dom

On Tue, Feb 5, 2013 at 5:42 PM, Enric Granda <enric.gra...@safelayer.com> wrote:
> Hi all,
>
> I've read these two sentences in the PDF reference:
>         * "Any object in a PDF file may be labeled as an indirect object"
>         * "The object can be referred to from elsewhere in the file by an
> indirect reference"
>
> I undestand it means that these two contents would be equivalent:
>         3 0 obj << /Type /Pages /Count 15 /Kids [5 0 R] >> endobj
> and
>         3 0 obj << /Type /Pages /Count 4 0 R /Kids 5 0 R >> endobj
>         4 0 obj 15 endobj
>
> But when I look into PdfDictionary class, it contains GetKeyAsXXX methods,
> for instance GetKeyAsLong, that don't check if the key is a reference:
>         long long PdfDictionary::GetKeyAsLong( const PdfName & key, long
> long lDefault ) const
>         {
>                 const PdfObject* pObject = GetKey( key );
>                 if( pObject && pObject->GetDataType() == ePdfDataType_Number
> )
>                 {
>                         return pObject->GetNumber();
>                 }
>                 return lDefault;
>         }
>
> I think it should also check if pObject is a reference.
> If it is a reference it should get the reference, check if it is a number
> and read it.
>
> Am I right or am I missing something ?
>
> Thanks in advance.
> ------------------------------------------------------------------------------
> Free Next-Gen Firewall Hardware Offer
> Buy your Sophos next-gen firewall before the end March 2013
> and get the hardware for free! Learn more.
> http://p.sf.net/sfu/sophos-d2d-feb
> _______________________________________________
> Podofo-users mailing list
> Podofo-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/podofo-users
>

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to