In function PdfString::SetHexData:
// Now check for the first two bytes, to see if we got a unicode string
> if( m_buffer.GetSize() > 4 )
> {
> m_bUnicode = (m_buffer.GetBuffer()[0] == static_cast<char>(0xFE) &&
> m_buffer.GetBuffer()[1] == static_cast<char>(0xFF));
>
> if( m_bUnicode )
> {
> PdfRefCountedBuffer temp( m_buffer.GetSize() - 2 );
> memcpy( temp.GetBuffer(), m_buffer.GetBuffer() + 2, m_buffer.
> GetSize() - 2 );
> m_buffer = temp;
> }
> }
That comparision "> 4" should be ">= 4". Because if is parsed pdf with
empty unicode strings like with objects like this (from pdf created by
openoffice with acroforms):
27 0 obj
<</Type/Annot/Subtype/Widget/F 4
/Rect[67.6 731.7 203.6 753.9]
/FT/Tx
/P 1 0 R
/T(SingleLineLeft)
/V <FEFF>
/DV <FEFF>
/DR<</Font 5 0 R>>
/DA(0 0 0 rg /F1 12 Tf)
/AP<<
/N 75 0 R
>>
>>
endobj
then its text value will be loaded by podofo as "þÿ" not as empty unicode
string what this should be. This is not only about acroforms but seems
empty unicode string with only unicode byte-order marker is legal.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users