Hello!

I stumbled upon an exception that ist thrown by "PdfElement::PdfElement( const char* pszType, PdfObject* pObject )".
It makes a check if the passed object is not of the correct type. But defining "type" is not mandatory in the PDF standard.
Only when it's given, it has to be correct.

Even Adobe example documents do not always define the type when its value is obviously clear (like in appearance streams, that
are XObjects).

So I modified the code to test if the attribute exists:

old (PdfElement.cpp, Line 57):
    if( pszType && m_pObject->GetDictionary().GetKeyAsName( PdfName::KeyType ) != pszType )

new:
    if( pszType && m_pObject->GetDictionary().HasKey( PdfName::KeyType ) && m_pObject->GetDictionary().GetKeyAsName( PdfName::KeyType ) != pszType)

Dominik, maybe you like to commit it!?

    Ulrich

PS: Can you provide an up to date version of the PoDoFo browser for download?
--
Besuchen Sie unseren Demo-Server - kostenlos & unverbindlich

Ulrich Simon
www.dots-software.com

dots Software GmbH - Schlesische Straße 27 - 10997 Berlin, Germany
Telefon: +49 - (0)30 - 695 799 - 47
Fax: +49 - (0)30 - 695 799 - 55
Amtsgericht Berlin Charlottenburg HRB 65201
Geschäftsführer: Hideki Okamura, Olaf Lorenz

------------------------------------------------------------------------------

_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to