I've resolved this issue in an admittedly hacky way. This may be
sufficient for this problem though. Attached is a patch which fixes the
issue. I've only done limited testing, but it does at least correct the
issue.
- Mike Slegeir
When using PdfContentsTokenizer with a PDF with an array for Contents
rather than a single stream, the tokenizer will reset its position to
the beginning of the first stream upon exhausting a stream. An Contents
array with contents X Y Z will appear as X X Y X Y Z to a user of the
PdfContentsTokenizer. Attached is a PDF which has a Contents array. I
can provide example code and output if necessary.
Index: src/PdfContentsTokenizer.cpp
===================================================================
--- src/PdfContentsTokenizer.cpp (revision 1140)
+++ src/PdfContentsTokenizer.cpp (working copy)
@@ -76,7 +76,9 @@
PdfBufferOutputStream stream( &m_curBuffer );
pStream->GetFilteredCopy( &stream );
+ std::streamoff position = m_device.Device() ? m_device.Device()->Tell() : 0;
m_device = PdfRefCountedInputDevice( m_curBuffer.GetBuffer(), m_curBuffer.GetSize() );
+ m_device.Device()->Seek(position);
}
bool PdfContentsTokenizer::ReadNext( EPdfContentsType& reType, const char*& rpszKeyword, PdfVariant & rVariant )
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users