Index: test/ContentParser/main.cpp
===================================================================
--- test/ContentParser/main.cpp	(revision 1081)
+++ test/ContentParser/main.cpp	(working copy)
@@ -12,7 +12,7 @@
 
 static bool print_output = false;
 
-void parse_contents( PdfContentsTokenizer* pTokenizer ) 
+void parse_contents( PdfContentsTokenizer* pTokenizer )
 {
     const char*      pszToken = NULL;
     PdfVariant       var;
@@ -33,7 +33,7 @@
                                         << " Keyword: " << pszToken << std::endl;
 
             // support 'l' and 'm' tokens
-            if( strcmp( pszToken, "l" ) == 0 ) 
+            if( strcmp( pszToken, "l" ) == 0 )
             {
                 double dPosY = stack.top().GetReal();
                 stack.pop();
@@ -42,7 +42,7 @@
 
                 if(print_output) std::cout << string(12,' ') << " LineTo: " << dPosX << " " << dPosY << std::endl;
             }
-            else if( strcmp( pszToken, "m" ) == 0 ) 
+            else if( strcmp( pszToken, "m" ) == 0 )
             {
                 double dPosY = stack.top().GetReal();
                 stack.pop();
@@ -60,6 +60,10 @@
                                        << " Variant: " << str << std::endl;
             stack.push( var );
         }
+        else if (eType == ePdfContentsType_ImageData)
+        {
+            if (print_output) std::cout << "Inline Image Data\n";
+        }
         else
         {
             // Impossible; type must be keyword or variant
@@ -82,7 +86,7 @@
     printf("       -p   Print parsed content stream to stdout\n");
 }
 
-int main( int argc, char* argv[] ) 
+int main( int argc, char* argv[] )
 {
     bool all_pages = false;
     int firstPageNo = 0;
Index: src/PdfContentsTokenizer.cpp
===================================================================
--- src/PdfContentsTokenizer.cpp	(revision 1081)
+++ src/PdfContentsTokenizer.cpp	(working copy)
@@ -26,14 +26,15 @@
 #include "PdfOutputStream.h"
 #include "PdfStream.h"
 #include "PdfVecObjects.h"
+#include "PdfData.h"
 
 namespace PoDoFo {
 
 PdfContentsTokenizer::PdfContentsTokenizer( PdfCanvas* pCanvas )
-    : PdfTokenizer()
+    : PdfTokenizer(), m_readingInlineImgData(false)
 {
     PdfObject* pContents = pCanvas->GetContents();
-    if( pContents && pContents->IsArray()  ) 
+    if( pContents && pContents->IsArray()  )
     {
         PdfArray& a = pContents->GetArray();
         for ( PdfArray::iterator it = a.begin(); it != a.end() ; ++it )
@@ -43,7 +44,7 @@
                 PODOFO_RAISE_ERROR_INFO( ePdfError_InvalidDataType, "/Contents array contained non-references" );
 
             }
-            
+
             m_lstContents.push_back( pContents->GetOwner()->GetObject( (*it).GetReference() ) );
         }
     }
@@ -77,6 +78,8 @@
 
 bool PdfContentsTokenizer::ReadNext( EPdfContentsType& reType, const char*& rpszKeyword, PdfVariant & rVariant )
 {
+    if (m_readingInlineImgData)
+        return ReadInlineImgData(reType, rpszKeyword, rVariant);
     EPdfTokenType eTokenType;
     EPdfDataType  eDataType;
     const char*   pszToken;
@@ -100,8 +103,8 @@
     {
         if ( m_lstContents.size() )
         {
-	    // We ran out of tokens in this stream. Switch to the next stream
-	    // and try again.
+        // We ran out of tokens in this stream. Switch to the next stream
+        // and try again.
             SetCurrentContentsStream( m_lstContents.front() );
             m_lstContents.pop_front();
             return ReadNext( reType, rpszKeyword, rVariant );
@@ -118,7 +121,7 @@
     // asume we read a variant unless we discover otherwise later.
     reType = ePdfContentsType_Variant;
 
-    switch( eDataType ) 
+    switch( eDataType )
     {
         case ePdfDataType_Null:
         case ePdfDataType_Bool:
@@ -158,7 +161,58 @@
             rpszKeyword = pszToken;
             break;
     }
+    std::string idKW ("ID");
+    if ((reType == ePdfContentsType_Keyword) && (idKW.compare(rpszKeyword) == 0) )
+        m_readingInlineImgData = true;
     return true;
 }
 
+bool PdfContentsTokenizer::ReadInlineImgData( EPdfContentsType& reType, const char*& rpszKeyword, PdfVariant & rVariant )
+{
+    int  c;
+    long long  counter  = 0;
+    if( !m_device.Device() )
+    {
+        PODOFO_RAISE_ERROR( ePdfError_InvalidHandle );
+    }
+
+    // cosume the only whitespace between ID and data
+    c = m_device.Device()->Look();
+    if( PdfTokenizer::IsWhitespace( c ) )
+    {
+        c = m_device.Device()->GetChar();
+    }
+
+    while( (c = m_device.Device()->Look()) != EOF
+           && counter < static_cast<long long>(m_buffer.GetSize()) )
+    {
+        if (PdfTokenizer::IsWhitespace(c))
+        {
+            // test if end-of-image-data is reached (hit EI keyword)
+            c = m_device.Device()->GetChar(); // skip the white space
+            char e = m_device.Device()->GetChar();
+            char i = m_device.Device()->GetChar();
+            m_device.Device()->Seek(-2, std::ios::cur);
+            if (e == 'E' && i == 'I')
+            {
+                m_buffer.GetBuffer()[counter] = '\0';
+                PdfData data(m_buffer.GetBuffer());
+                PdfVariant var(data);
+                rVariant = var;
+                reType = ePdfContentsType_ImageData;
+                m_readingInlineImgData = false;
+                return true;
+            }
+            m_buffer.GetBuffer()[counter] = c;
+            ++counter;
+        }
+        else
+        {
+            c = m_device.Device()->GetChar();
+            m_buffer.GetBuffer()[counter] = c;
+            ++counter;
+        }
+    }
+    return false;
+}
 };
Index: src/PdfContentsTokenizer.h
===================================================================
--- src/PdfContentsTokenizer.h	(revision 1081)
+++ src/PdfContentsTokenizer.h	(working copy)
@@ -37,7 +37,8 @@
  */
 enum EPdfContentsType {
     ePdfContentsType_Keyword, ///< A keyword is a PDF function
-    ePdfContentsType_Variant  ///< A variant is usually a parameter to a keyword 
+    ePdfContentsType_Variant, ///< A variant is usually a parameter to a keyword
+    ePdfContentsType_ImageData ///< This indicates inline image data (binary data between ID/EI)
 };
 
 /** This class is a parser for content streams in PDF documents.
@@ -60,7 +61,7 @@
     {
     }
 
-    /** Construct a PdfContentsTokenizer from a PdfCanvas 
+    /** Construct a PdfContentsTokenizer from a PdfCanvas
      *  (i.e. PdfPage or a PdfXObject).
      *
      *  This is more convinient as you do not have
@@ -71,7 +72,7 @@
     PdfContentsTokenizer( PdfCanvas* pCanvas );
 
     virtual ~PdfContentsTokenizer() { }
-    
+
     /** Read the next keyword or variant, returning true and setting reType if something was read.
      *  Either rpszKeyword or rVariant, but never both, have defined and usable values on
      *  true return, with which being controlled by the value of eType.
@@ -86,7 +87,7 @@
      *              otherwise the value is undefined. If set, the value points to memory owned by the
      *              PdfContentsTokenizer and must not be freed. The value is invalidated when ReadNext
      *              is next called or when the PdfContentsTokenizer is destroyed.
-     *        
+     *
      *  \param[out] rVariant if pType is set to ePdfContentsType_Variant this will be set to the read variant,
      *              otherwise the value is undefined.
      *
@@ -99,10 +100,12 @@
      *  \param pObject use the stream of this object for parsing
      */
     void SetCurrentContentsStream( PdfObject* pObject );
+    bool ReadInlineImgData(EPdfContentsType& reType, const char*& rpszKeyword, PoDoFo::PdfVariant & rVariant);
 
  private:
     PdfRefCountedBuffer       m_curBuffer;    ///< A copy of the current contents stream
-    std::list<PdfObject*>     m_lstContents;  ///< A list containing pointers to all contents objects 
+    std::list<PdfObject*>     m_lstContents;  ///< A list containing pointers to all contents objects
+    bool                      m_readingInlineImgData;  ///< A state of reading inline image data
 };
 
 };
