https://bugs.documentfoundation.org/show_bug.cgi?id=106057
--- Comment #14 from Kevin Suo <[email protected]> --- sdext/source/pdfimport/pdfiadaptor.cxx PDFIRawAdaptor::importer (in line 291): calls /source/pdfimport/pdfiadaptor.cxx PDFIRawAdaptor::parse (in line 217) which calls (in line 231): sdext/source/pdfimport/wrappter/wrapper.cxx xpdf_ImportFromStream (in line 1182) xpdf_ImportFromStream copied the pdf content to a temp file because the caller has passed in a file stream thus xInput.is() is true. I don't think it is necessary to make such temp file - why not pass the url of the original PDF file and then use the xpdf_ImportFromFile directly? Anyway,this is a separate issue. xpdf_ImportFromStream then calls: sdext/source/pdfimport/wrappter/wrapper.cxx xpdf_ImportFromFile (in line 998) which uses the temp file as the data source xpdf_ImportFromFile then calls (in line 1020): sdext/source/pdfimport/wrappter/wrapper.cxx checkEncryption (in line 891) (Poppler has the check encryption functionality, so why do we use our own encryption checking here? I think it is because we need to show a dialog to ask for password if it is encrypted. But how about we ask poppler to check encryption, and if poppler tells it is encrypted, then we provide the password through stdin?) checkEncryption then calls (in line 901): sdext/source/pdfimport/pdfparse/pdfparse.cxx pdfparse::PDFReader::read (there are two such function, one for win32 and another for the "else". I am confused by those #ifdef _WIN32 stuff, but for me on linux it is in line 608. Interestingly, there is another #ifdef _WIN32 in this block, and my program jumps to line 637 directly) Take note of the aGrammar: PDFGrammar< file_iterator<> > aGrammar( file_start ); pdfparse::PDFReader::read then calls boost::spirit::classic::parse, which took several seconds (maybe a performance issue here?) But there is no exception here yet: boost::spirit::classic::parse( file_start, file_end, aGrammar, boost::spirit::classic::space_p ); Then, finally, in line 672 we get the nEntries: unsigned int nEntries = aGrammar.m_aObjectStack.size(); And its value is 2 for this pdf, as a result a pRet is not set in line 679 block, thus in xpdf_ImportFromFile it returned False. I am not familiar with the boost::spirit::classic::parse staff, thus not sure why the aGrammar.m_aObjectStack.size() is 2. -- You are receiving this mail because: You are the assignee for the bug.
