From: Jozef Misutka <misutkajunior@ho...> - 2009-03-12 09:45:46
i am not able to delinearize any pdf file with the new tool but found one crash. i think it can be the same problem as i had before with FileStream not able to create valid substreams! the position in the new substream is one less than it should be. i better forgot about FileStream and used MemStream. i had these problems in parse_object.cc and i solved it this nasty|quick way.====== string file = vm["file"].as(); // xpdf ufff who deletes the stuff? OS idiom used :) ifstream ffile (file.c_str(), ios::in|ios::binary|ios::ate); long size = ffile.tellg(); ffile.seekg (0, ios::beg); char* buf = new char[size]; ffile.read (buf, size); ffile.close(); xpdf::XpdfObject obj; ::MemStream* stream = new ::MemStream (buf, 0, size, obj.get(), true); // this is really NASTY stream->reset (); ::Lexer* lexer = new ::Lexer (NULL, stream); ::Parser parser (NULL, lexer, gTrue);======/jozo
Windows Live™ Groups: Create an online spot for your favorite groups to meet.
Get latest updates about Open Source Projects, Conferences and News.