Bumping this.
Has anyone successfully built an XCode project and been able to load a
password-protected PDF?
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
>
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users