I'm new to using PoDoFo in c++, but I have problems using the PdfMemDocument. It seems that there is an bug in the lib, but I'm not sure.
my code:
PoDoFo::PdfMemDocument document;
long len = buffer.size();
document.Load( reinterpret_cast<char*>( buffer.getBuffer() ) , len );
for (int pn = 0; pn < document.GetPageCount(); ++pn)
{
auto* page = document.GetPage( pn );
page->SetRotation( rotation );
}
PoDoFo::PdfOutputDevice output( reinterpret_cast<char*>( buffer.getBuffer() ), buffer.size() );
document.Write( &output );
output.Read( reinterpret_cast<char*>( buffer.getBuffer() ), buffer.size() );
buffer.setSize( output.GetLength() );
The buffer contains the right data. I have tested that. The stack error occurs when the program is finished. Stacktrace:
#0 0xf7710be9 in __kernel_vsyscall ()
#1 0xf673dea9 in raise () from /lib/i386-linux-gnu/libc.so.6
#2 0xf673f4d8 in abort () from /lib/i386-linux-gnu/libc.so.6
#3 0xf677937c in ?? () from /lib/i386-linux-gnu/libc.so.6
#4 0xf6809548 in __fortify_fail () from /lib/i386-linux-gnu/libc.so.6
#5 0xf68094d8 in __stack_chk_fail () from /lib/i386-linux-gnu/libc.so.6
#60x0805af74 in __stack_chk_fail_local ()
the problem also occurs if I'm only generating the PdfMemDocument object at the end of my Program.
thanks for the help