Index: src/podofo/base/PdfParser.cpp
===================================================================
--- src/podofo/base/PdfParser.cpp	(revision 1999)
+++ src/podofo/base/PdfParser.cpp	(working copy)
@@ -190,7 +190,7 @@
     m_nRecursionDepth = 0;
 }
 
-void PdfParser::ParseFile( const char* pszFilename, bool bLoadOnDemand )
+void PdfParser::ParseFile( const char* pszFilename, bool bLoadOnDemand, bool bIgnoreBrokenObjects )
 {
     if( !pszFilename || !pszFilename[0] )
     {
@@ -203,11 +203,11 @@
         PODOFO_RAISE_ERROR_INFO( ePdfError_FileNotFound, pszFilename );
     }
 
-    this->ParseFile( device, bLoadOnDemand );
+    this->ParseFile( device, bLoadOnDemand, bIgnoreBrokenObjects );
 }
 
 #ifdef _WIN32
-void PdfParser::ParseFile( const wchar_t* pszFilename, bool bLoadOnDemand )
+void PdfParser::ParseFile( const wchar_t* pszFilename, bool bLoadOnDemand, bool bIgnoreBrokenObjects )
 {
     if( !pszFilename || !pszFilename[0] )
     {
@@ -222,11 +222,11 @@
 		throw e;
 	}
 
-    this->ParseFile( device, bLoadOnDemand );
+    this->ParseFile( device, bLoadOnDemand, bIgnoreBrokenObjects );
 }
 #endif // _WIN32
 
-void PdfParser::ParseFile( const char* pBuffer, long lLen, bool bLoadOnDemand )
+void PdfParser::ParseFile( const char* pBuffer, long lLen, bool bLoadOnDemand, bool bIgnoreBrokenObjects )
 {
     if( !pBuffer || !lLen )
     {
@@ -239,10 +239,10 @@
         PODOFO_RAISE_ERROR_INFO( ePdfError_InvalidHandle, "Cannot create PdfParser from buffer." );
     }
 
-    this->ParseFile( device, bLoadOnDemand );
+    this->ParseFile( device, bLoadOnDemand, bIgnoreBrokenObjects );
 }
 
-void PdfParser::ParseFile( const PdfRefCountedInputDevice & rDevice, bool bLoadOnDemand )
+void PdfParser::ParseFile( const PdfRefCountedInputDevice & rDevice, bool bLoadOnDemand, bool bIgnoreBrokenObjects )
 {
     Clear();
 
@@ -250,6 +250,8 @@
 
     m_bLoadOnDemand = bLoadOnDemand;
 
+    m_bIgnoreBrokenObjects = bIgnoreBrokenObjects;
+
     try {
         if( !IsPdfFile() )
         {
@@ -1178,7 +1180,7 @@
                     << " Index = " << i << std::endl;
                 delete pObject;
 
-                if( m_bIgnoreBrokenObjects ) 
+                if( m_bIgnoreBrokenObjects )
                 {
                     PdfError::LogMessage( eLogSeverity_Error, oss.str().c_str() );
                     m_vecObjects->AddFreeObject( PdfReference( i, 0 ) );
@@ -1304,7 +1306,15 @@
         std::ostringstream oss;
         oss << "Loading of object " << nObjNo << " 0 R failed!" << std::endl;
 
-        PODOFO_RAISE_ERROR_INFO( ePdfError_NoObject, oss.str().c_str() );
+        if ( m_bIgnoreBrokenObjects )
+        {
+            PdfError::LogMessage( eLogSeverity_Error, oss.str().c_str() );
+            return;
+        }
+        else
+        {
+            PODOFO_RAISE_ERROR_INFO( ePdfError_NoObject, oss.str().c_str() );
+        }
     }
     
 
Index: src/podofo/base/PdfParser.h
===================================================================
--- src/podofo/base/PdfParser.h	(revision 1999)
+++ src/podofo/base/PdfParser.h	(working copy)
@@ -180,6 +180,8 @@
      *                       If false all objects will be read immediately.
      *                       This is faster if you do not need the complete PDF 
      *                       file in memory.
+     *  \param bIgnoreBrokenObjects If true parsing will continue after broken
+     *                              objects are encountered.
      *
      *
      *  This might throw a PdfError( ePdfError_InvalidPassword ) exception
@@ -188,7 +190,7 @@
      *  
      *  \see SetPassword
      */
-    void ParseFile( const char* pszFilename, bool bLoadOnDemand = true );
+    void ParseFile( const char* pszFilename, bool bLoadOnDemand = true, bool bIgnoreBrokenObjects = false );
 
 #ifdef _WIN32
     /** Open a PDF file and parse it.
@@ -199,6 +201,8 @@
      *                       If false all objects will be read immediately.
      *                       This is faster if you do not need the complete PDF 
      *                       file in memory.
+     *  \param bIgnoreBrokenObjects If true parsing will continue after broken
+     *                              objects are encountered.
      *
      *
      *  This might throw a PdfError( ePdfError_InvalidPassword ) exception
@@ -211,7 +215,7 @@
      *
      *  \see SetPassword
      */
-    void ParseFile( const wchar_t* pszFilename, bool bLoadOnDemand = true );
+    void ParseFile( const wchar_t* pszFilename, bool bLoadOnDemand = true, bool bIgnoreBrokenObjects = false );
 #endif // _WIN32
 
     /** Open a PDF file and parse it.
@@ -223,6 +227,8 @@
      *                       If false all objects will be read immediately.
      *                       This is faster if you do not need the complete PDF 
      *                       file in memory.
+     *  \param bIgnoreBrokenObjects If true parsing will continue after broken
+     *                              objects are encountered.
      *
      *
      *  This might throw a PdfError( ePdfError_InvalidPassword ) exception
@@ -231,7 +237,7 @@
      *  
      *  \see SetPassword
      */
-    void ParseFile( const char* pBuffer, long lLen, bool bLoadOnDemand = true );
+    void ParseFile( const char* pBuffer, long lLen, bool bLoadOnDemand = true, bool bIgnoreBrokenObjects = false );
 
     /** Open a PDF file and parse it.
      *
@@ -241,6 +247,8 @@
      *                       If false all objects will be read immediately.
      *                       This is faster if you do not need the complete PDF 
      *                       file in memory.
+     *  \param bIgnoreBrokenObjects If true parsing will continue after broken
+     *                              objects are encountered.
      *
      *
      *  This might throw a PdfError( ePdfError_InvalidPassword ) exception
@@ -249,7 +257,7 @@
      *  
      *  \see SetPassword
      */
-    void ParseFile( const PdfRefCountedInputDevice & rDevice, bool bLoadOnDemand = true );
+    void ParseFile( const PdfRefCountedInputDevice & rDevice, bool bLoadOnDemand = true, bool bIgnoreBrokenObjects = false );
 
     /** Quick method to detect secured PDF files, i.e.
      *  a PDF with an /Encrypt key in the trailer directory.
Index: src/podofo/doc/PdfMemDocument.cpp
===================================================================
--- src/podofo/doc/PdfMemDocument.cpp	(revision 1999)
+++ src/podofo/doc/PdfMemDocument.cpp	(working copy)
@@ -92,7 +92,7 @@
     m_eSourceVersion = m_eVersion;
 }
 
-PdfMemDocument::PdfMemDocument( const char* pszFilename, bool bForUpdate )
+PdfMemDocument::PdfMemDocument( const char* pszFilename, bool bForUpdate, bool bIgnoreBrokenObjects )
     : PdfDocument(), m_pEncrypt( NULL ), m_pParser( NULL ), m_bSoureHasXRefStream( false ), m_lPrevXRefOffset( -1 ),
 #ifdef _WIN32
       m_wchar_pszUpdatingFilename( NULL ),
@@ -99,17 +99,17 @@
 #endif
       m_pszUpdatingFilename( NULL ), m_pUpdatingInputDevice( NULL )
 {
-    this->Load( pszFilename, bForUpdate );
+    this->Load( pszFilename, bForUpdate, bIgnoreBrokenObjects );
 }
 
 #ifdef _WIN32
 #if defined(_MSC_VER)  &&  _MSC_VER <= 1200    // not for MS Visual Studio 6
 #else
-PdfMemDocument::PdfMemDocument( const wchar_t* pszFilename, bool bForUpdate )
+PdfMemDocument::PdfMemDocument( const wchar_t* pszFilename, bool bForUpdate, bool bIgnoreBrokenObjects )
     : PdfDocument(), m_pEncrypt( NULL ), m_pParser( NULL ), m_bSoureHasXRefStream( false ), m_lPrevXRefOffset( -1 ),
       m_wchar_pszUpdatingFilename( NULL ), m_pszUpdatingFilename( NULL ), m_pUpdatingInputDevice( NULL )
 {
-    this->Load( pszFilename, bForUpdate );
+    this->Load( pszFilename, bForUpdate, bIgnoreBrokenObjects );
 }
 #endif
 #endif // _WIN32
@@ -233,7 +233,7 @@
     }
 }
 
-void PdfMemDocument::Load( const char* pszFilename, bool bForUpdate )
+void PdfMemDocument::Load( const char* pszFilename, bool bForUpdate, bool bIgnoreBrokenObjects )
 {
     if( !pszFilename || !pszFilename[0] )
     {
@@ -254,7 +254,7 @@
     // so that m_pParser is initialized for encrypted documents
     m_pParser = new PdfParser( PdfDocument::GetObjects() );
     try {
-        m_pParser->ParseFile( pszFilename, true );
+        m_pParser->ParseFile( pszFilename, true, bIgnoreBrokenObjects );
         InitFromParser( m_pParser );
     } catch (PdfError& e) {
         if ( e.GetError() != ePdfError_InvalidPassword )
@@ -267,7 +267,7 @@
 }
 
 #ifdef _WIN32
-void PdfMemDocument::Load( const wchar_t* pszFilename, bool bForUpdate )
+void PdfMemDocument::Load( const wchar_t* pszFilename, bool bForUpdate, bool bIgnoreBrokenObjects )
 {
     if( !pszFilename || !pszFilename[0] )
     {
@@ -287,12 +287,12 @@
     // Call parse file instead of using the constructor
     // so that m_pParser is initialized for encrypted documents
     m_pParser = new PdfParser( PdfDocument::GetObjects() );
-    m_pParser->ParseFile( pszFilename, true );
+    m_pParser->ParseFile( pszFilename, true, bIgnoreBrokenObjects );
     InitFromParser( m_pParser );
 }
 #endif // _WIN32
 
-void PdfMemDocument::LoadFromBuffer( const char* pBuffer, long lLen, bool bForUpdate )
+void PdfMemDocument::LoadFromBuffer( const char* pBuffer, long lLen, bool bForUpdate, bool bIgnoreBrokenObjects )
 {
     if( !pBuffer || !lLen )
     {
@@ -309,11 +309,11 @@
     // Call parse file instead of using the constructor
     // so that m_pParser is initialized for encrypted documents
     m_pParser = new PdfParser( PdfDocument::GetObjects() );
-    m_pParser->ParseFile( pBuffer, lLen, true );
+    m_pParser->ParseFile( pBuffer, lLen, true, bIgnoreBrokenObjects );
     InitFromParser( m_pParser );
 }
 
-void PdfMemDocument::LoadFromDevice( const PdfRefCountedInputDevice & rDevice, bool bForUpdate )
+void PdfMemDocument::LoadFromDevice( const PdfRefCountedInputDevice & rDevice, bool bForUpdate, bool bIgnoreBrokenObjects )
 {
     this->Clear();
 
@@ -325,7 +325,7 @@
     // Call parse file instead of using the constructor
     // so that m_pParser is initialized for encrypted documents
     m_pParser = new PdfParser( PdfDocument::GetObjects() );
-    m_pParser->ParseFile( rDevice, true );
+    m_pParser->ParseFile( rDevice, true, bIgnoreBrokenObjects );
     InitFromParser( m_pParser );
 }
     
Index: src/podofo/doc/PdfMemDocument.h
===================================================================
--- src/podofo/doc/PdfMemDocument.h	(revision 1999)
+++ src/podofo/doc/PdfMemDocument.h	(working copy)
@@ -91,6 +91,7 @@
     /** Construct a PdfMemDocument from an existing PDF (on disk)
      *  \param pszFilename filename of the file which is going to be parsed/opened
      *  \param bForUpdate whether to load for incremental update
+     *  \param bIgnoreBrokenObjects whether to ignore broken objects during parsing
      *
      *  This might throw a PdfError( ePdfError_InvalidPassword ) exception
      *  if a password is required to read this PDF.
@@ -101,7 +102,7 @@
      *  
      *  \see SetPassword, WriteUpdate
      */
-    PdfMemDocument( const char* pszFilename, bool bForUpdate = false );
+    PdfMemDocument( const char* pszFilename, bool bForUpdate = false, bool bIgnoreBrokenObjects = false );
 
 #ifdef _WIN32
 #if defined(_MSC_VER)  &&  _MSC_VER <= 1200    // not for MS Visual Studio 6
@@ -109,6 +110,7 @@
     /** Construct a PdfMemDocument from an existing PDF (on disk)
      *  \param pszFilename filename of the file which is going to be parsed/opened
      *  \param bForUpdate whether to load for incremental update
+     *  \param bIgnoreBrokenObjects whether to ignore broken objects during parsing
      *
      *  This might throw a PdfError( ePdfError_InvalidPassword ) exception
      *  if a password is required to read this PDF.
@@ -123,7 +125,7 @@
      *
      *  \see SetPassword, WriteUpdate
      */
-    PdfMemDocument( const wchar_t* pszFilename, bool bForUpdate = false );
+    PdfMemDocument( const wchar_t* pszFilename, bool bForUpdate = false, bool bIgnoreBrokenObjects = false );
 #endif
 #endif // _WIN32
 
@@ -135,6 +137,7 @@
      *
      *  \param pszFilename filename of the file which is going to be parsed/opened
      *  \param bForUpdate whether to load for incremental update
+     *  \param bIgnoreBrokenObjects whether to ignore broken objects during parsing
      *
      *  This might throw a PdfError( ePdfError_InvalidPassword ) exception
      *  if a password is required to read this PDF.
@@ -145,7 +148,7 @@
      *  
      *  \see SetPassword, WriteUpdate, LoadFromBuffer, LoadFromDevice
      */
-    void Load( const char* pszFilename, bool bForUpdate = false );
+    void Load( const char* pszFilename, bool bForUpdate = false, bool bIgnoreBrokenObjects = false );
 
 #ifdef _WIN32
     /** Load a PdfMemDocument from a file
@@ -152,6 +155,7 @@
      *
      *  \param pszFilename filename of the file which is going to be parsed/opened
      *  \param bForUpdate whether to load for incremental update
+     *  \param bIgnoreBrokenObjects whether to ignore broken objects during parsing
      *
      *  This might throw a PdfError( ePdfError_InvalidPassword ) exception
      *  if a password is required to read this PDF.
@@ -166,7 +170,7 @@
      *
      *  \see SetPassword, WriteUpdate, LoadFromBuffer, LoadFromDevice
      */
-    void Load( const wchar_t* pszFilename, bool bForUpdate = false );
+    void Load( const wchar_t* pszFilename, bool bForUpdate = false, bool bIgnoreBrokenObjects = false );
 #endif // _WIN32
 
     /** Load a PdfMemDocument from a buffer in memory
@@ -174,6 +178,7 @@
      *  \param pBuffer a memory area containing the PDF data
      *  \param lLen length of the buffer
      *  \param bForUpdate whether to load for incremental update
+     *  \param bIgnoreBrokenObjects whether to ignore broken objects during parsing
      *
      *  This might throw a PdfError( ePdfError_InvalidPassword ) exception
      *  if a password is required to read this PDF.
@@ -184,12 +189,13 @@
      *  
      *  \see SetPassword, WriteUpdate, Load, LoadFromDevice
      */
-    void LoadFromBuffer( const char* pBuffer, long lLen, bool bForUpdate = false );
+    void LoadFromBuffer( const char* pBuffer, long lLen, bool bForUpdate = false, bool bIgnoreBrokenObjects = false );
 
     /** Load a PdfMemDocument from a PdfRefCountedInputDevice
      *
      *  \param rDevice the input device containing the PDF
      *  \param bForUpdate whether to load for incremental update
+     *  \param bIgnoreBrokenObjects whether to ignore broken objects during parsing
      *
      *  This might throw a PdfError( ePdfError_InvalidPassword ) exception
      *  if a password is required to read this PDF.
@@ -200,7 +206,7 @@
      *  
      *  \see SetPassword, WriteUpdate, Load, LoadFromBuffer
      */
-    void LoadFromDevice( const PdfRefCountedInputDevice & rDevice, bool bForUpdate = false );
+    void LoadFromDevice( const PdfRefCountedInputDevice & rDevice, bool bForUpdate = false, bool bIgnoreBrokenObjects = false );
 
     /** Returns whether the document is fully loaded.
      */
