Hello,

I was wondering if anyone has seen this. I would dearly appreciate some
help in this matter.

Ismael

2014-12-17 17:18 GMT-02:00 Ismael Schellemberg <isma...@gmail.com>:

> Greetings
>
> I've downloaded the latest PoDoFo (version 0.9.3) and I'm trying to load
> an encrypted PDF, but I can't seem to get it to work.
>
> Here's what I'm doing:
>
>     try {
>
>         PdfMemDocument *doc;
>
>         doc = new PdfMemDocument();
>
>         try {
>
>             doc->Load("/Users/ismael/Downloads/password_Password01.pdf");
>
>         } catch (PdfError &error) {
>
>             if (error.GetError() == ePdfError_InvalidPassword) {
>
>                 doc->SetPassword("Password01");
>
>             } else {
>
>                 return false;
>
>             }
>
>         }
>
>         doc->Write("/Users/ismael/Downloads/output_Password01.pdf");
>
>     } catch (PdfError &error) {
>
>         return false;
>
>     }
>
>
> doc->Load(...); throws an InvalidPassword error, as expected, but when I
> do doc->SetPassword(...); it throws an InternalLogic error. Debugging I
> found that the error comes from PdfEncrypt.cpp.Decrypt(...) here:
>
>     status = EVP_DecryptFinal_ex( aes, pBuffer + lOutLen, &lStepOutLen );
>
>         if( status != 1 )
>
>                 PODOFO_RAISE_ERROR_INFO( ePdfError_InternalLogic, "Error
> AES-decryption data padding" );
>
>
> EVP_DecryptFinal_ex returns 0 and then the error is raised. This is
> happening to me with three different PDF files that were generated in
> different ways. They work normally on any viewer application, and I'm at a
> loss as to why this is not working.
>
>
> Sincerely,
>
> Ismael
>
------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to