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
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to