Hello all,

I'm trying to read attached password-protected (password is 'password') 
document with following piece of code:
-----
        PdfMemDocument document;
        try {
                document.Load(pdfFile);
        } catch (PdfError& e) {
                if ((e.GetError() == ePdfError_InvalidPassword) && pcarPassword)
                        document.SetPassword(pcarPassword);
                else {
                        raiseError(e);
                        return;
                }
        }
-----

But it raise an error when calling SetPassword() with following stack:
        PdfError::AddToCallstack(const char * pszFile, int line, const char * 
pszInformation)  Line 522 C++
        PdfError::SetError(const PoDoFo::EPdfError & eCode, const char * 
pszFile, int line, const char * pszInformation)  Line 515      C++
        PdfError::PdfError(const PoDoFo::EPdfError & eCode, const char * 
pszFile, int line, const char * pszInformation)  Line 114      C++
        PdfAESStream::Decrypt(unsigned char * pBuffer, int lLen, int * 
pTotalLeft)  Line 411 + 0x2b bytes       C++
        PdfAESInputStream::Read(char * pBuffer, int lLen, int * pTotalLeft)  
Line 468   C++
        PdfStream::SetRawData(PoDoFo::PdfInputStream * pStream, int lLen)  Line 
186 + 0x2c bytes        C++
        PdfParserObject::ParseStream()  Line 348        C++
        PdfParserObject::DelayedStreamLoadImpl()  Line 396 + 0x8 bytes  C++
        PdfObject::DelayedStreamLoad()  Line 459 + 0xf bytes    C++
        PdfObject::GetStream()  Line 258        C++
        PdfObjectStreamParserObject::Parse(const 
std::vector<__int64,std::allocator<__int64> > & list)  Line 70 + 0x15 bytes    
C++
        PdfParser::ReadObjectFromStream(int nObjNo, int __formal)  Line 1313    
C++
        PdfParser::ReadObjectsInternal()  Line 1233     C++
        PdfParser::SetPassword(const 
std::basic_string<char,std::char_traits<char>,std::allocator<char> > & 
sPassword)  Line 1277       C++
        PdfMemDocument::SetPassword(const 
std::basic_string<char,std::char_traits<char>,std::allocator<char> > & 
sPassword)  Line 425   C++

The call returning an error in PdfEncrypt.cpp is at line 400:
        status = EVP_DecryptUpdate( aes, pBuffer, &lOutLen, pBuffer + 
AES_IV_LENGTH, lLen - AES_IV_LENGTH );

Thank you in advance for your help.

Cordialement/Best Regards,
Christophe Blanchard

This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systemes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.

For other languages, go to http://www.3ds.com/terms/email-disclaimer

------------------------------------------------------------------------------
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

Reply via email to