Re: [Podofo-users] Problem with loading password protected PDF
On Wed, 2016-05-11 at 09:59 +0200, F. E. wrote: > we created a patch ourselves, I'll just attach it and hope it fits Hi, it looks fine, I only moved the line above the MESSAGE and indented it with it. I committed your change as revision 1723: https://sourceforge.net/p/podofo/code/1723 Bye, zyx -- http://www.litePDF.cz i...@litepdf.cz -- Mobile security can be enabling, not merely restricting. Employees who bring their own devices (BYOD) to work are irked by the imposition of MDM restrictions. Mobile Device Manager Plus allows you to control only the apps on BYO-devices by containerizing them, leaving personal data untouched! https://ad.doubleclick.net/ddm/clk/304595813;131938128;j ___ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users
Re: [Podofo-users] Problem with loading password protected PDF
Hi, we created a patch ourselves, I'll just attach it and hope it fits :). Best regards F.E. 2016-05-10 20:57 GMT+02:00 zyx: > On Tue, 2016-05-10 at 18:07 +0200, F. E. wrote: > > Is there a reason the INCLUDE_DIRECTORIES are not set for OpenSSL or > > is it just a bug? > > Hi, > I believe it's just a bug. Could you share your change in a form of a > patch, please? (If you are not having a svn checkout, then have a file > before your change, then after and generate the patch using diff > command: >$ diff -up file.before file.after >change.patch > There are available windows executables for the diff too. The "-up" > parameter tells the diff to create a unified diff and reference the > method it is diffing in (usually in C/C++ code it's that method, even > not always). > Thanks and bye, > Milan > -- > http://www.litePDF.cz i...@litepdf.cz > > > -- > Mobile security can be enabling, not merely restricting. Employees who > bring their own devices (BYOD) to work are irked by the imposition of MDM > restrictions. Mobile Device Manager Plus allows you to control only the > apps on BYO-devices by containerizing them, leaving personal data > untouched! > https://ad.doubleclick.net/ddm/clk/304595813;131938128;j > ___ > Podofo-users mailing list > Podofo-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/podofo-users > podofo_cmakelists_add_openssl_include.patch Description: Binary data -- Mobile security can be enabling, not merely restricting. Employees who bring their own devices (BYOD) to work are irked by the imposition of MDM restrictions. Mobile Device Manager Plus allows you to control only the apps on BYO-devices by containerizing them, leaving personal data untouched! https://ad.doubleclick.net/ddm/clk/304595813;131938128;j___ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users
Re: [Podofo-users] Problem with loading password protected PDF
On Tue, 2016-05-10 at 18:07 +0200, F. E. wrote: > Is there a reason the INCLUDE_DIRECTORIES are not set for OpenSSL or > is it just a bug? Hi, I believe it's just a bug. Could you share your change in a form of a patch, please? (If you are not having a svn checkout, then have a file before your change, then after and generate the patch using diff command: $ diff -up file.before file.after >change.patch There are available windows executables for the diff too. The "-up" parameter tells the diff to create a unified diff and reference the method it is diffing in (usually in C/C++ code it's that method, even not always). Thanks and bye, Milan -- http://www.litePDF.cz i...@litepdf.cz -- Mobile security can be enabling, not merely restricting. Employees who bring their own devices (BYOD) to work are irked by the imposition of MDM restrictions. Mobile Device Manager Plus allows you to control only the apps on BYO-devices by containerizing them, leaving personal data untouched! https://ad.doubleclick.net/ddm/clk/304595813;131938128;j ___ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users
Re: [Podofo-users] Problem with loading password protected PDF
Hello again, Thanks for the last answer. I tried running the encrypt.cpp, but encountered compile, link and runtime errors (bad alloc). With the help of a collegue we started from scratch and rebuilt podofo and all dependent libraries. Now it's working, my example code as well as encrypt.cpp. When using CMake to generate the vs project files, however, we encountered an minor issue with the generation. Although we specified everything needed for OpenSSL (-DCMAKE_INCLUDE_PATH / -DCMAKE_LIBRARY_PATH / -DLIBCRYPTO_LIBRARY_NAMES_DEBUG / -DLIBCRYPTO_LIBRARY_NAMES_RELEASE) and OpenSSL got enabled in podofo_config.h, the include directories were not added to the projects. That resulted in a compile error (missing header in PDFEncrypt.cpp). We checked CMakeLists.txt and found that there was no INCLUDE_DIRECTORIES call for the OpenSSl include dir (line 322ff.), unlike with other libraries like libjpeg. We added that call and it generated the project files correctly. But we're not sure if that solution is correct. Is there a reason the INCLUDE_DIRECTORIES are not set for OpenSSL or is it just a bug? Best regards, F.E. 2016-05-04 19:52 GMT+02:00 zyx: > On Wed, 2016-05-04 at 09:45 +0200, Max Müller wrote: > > when playing around with Podofo I stumbled upon an issue that I'm not > > able to load password protected PDFs. > > Hi, > could you try to compile and run the encrypt.cpp attached at > https://sourceforge.net/p/podofo/mailman/message/34065834/ > please? That works for me fine. It uses the same method (way of loading > the files it created) as you outlined here. There might also be related > whether you compiled with the openssl and the encryption/decryption > method the PDF file is encrypted supported. > > With respect of PDF file sharing, if you can make a very simple and > small example PDF which fails for you, with no confidential data, then > there's no problem to send it to this mailing list, I believe. > Bye, > zyx > > -- > http://www.litePDF.cz i...@litepdf.cz > > > -- > Find and fix application performance issues faster with Applications > Manager > Applications Manager provides deep performance insights into multiple > tiers of > your business applications. It resolves application problems quickly and > reduces your MTTR. Get your free trial! > https://ad.doubleclick.net/ddm/clk/302982198;130105516;z > ___ > Podofo-users mailing list > Podofo-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/podofo-users > -- Mobile security can be enabling, not merely restricting. Employees who bring their own devices (BYOD) to work are irked by the imposition of MDM restrictions. Mobile Device Manager Plus allows you to control only the apps on BYO-devices by containerizing them, leaving personal data untouched! https://ad.doubleclick.net/ddm/clk/304595813;131938128;j___ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users
Re: [Podofo-users] Problem with loading password protected PDF
On Wed, 2016-05-04 at 09:45 +0200, Max Müller wrote: > when playing around with Podofo I stumbled upon an issue that I'm not > able to load password protected PDFs. Hi, could you try to compile and run the encrypt.cpp attached at https://sourceforge.net/p/podofo/mailman/message/34065834/ please? That works for me fine. It uses the same method (way of loading the files it created) as you outlined here. There might also be related whether you compiled with the openssl and the encryption/decryption method the PDF file is encrypted supported. With respect of PDF file sharing, if you can make a very simple and small example PDF which fails for you, with no confidential data, then there's no problem to send it to this mailing list, I believe. Bye, zyx -- http://www.litePDF.cz i...@litepdf.cz -- Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! https://ad.doubleclick.net/ddm/clk/302982198;130105516;z ___ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users
[Podofo-users] Problem with loading password protected PDF
Hello, when playing around with Podofo I stumbled upon an issue that I'm not able to load password protected PDFs. I already saw some earlier issues from other people (e.g. https://www.mail-archive.com/podofo-users@lists.sourceforge.net/msg01145.html), but that doesn't help me. My procedure: I create the PDfMemDocument Object, call Load on it, catch the InvalidPassword error and provide the correct one by calling SetPassword. But that results in the InvalidPassword error as well. I'm absolutely sure my password is correct, since I can view the file with it in a PDF Viewer. Has someone a hint what I'm doing wrong? Code: void TestPDFLoad( const std::string& pdfFile, const std::string& pdfPwd ) { std::shared_ptr< PdfMemDocument > pDocument ( new PdfMemDocument() ); try { pDocument->Load( pdfFile.c_str() ); return; } catch ( PdfError error ) { EPdfError errorCode = error.GetError(); if ( ePdfError_InvalidPassword != error.GetError() ) { error.PrintErrorMsg(); return; } } // Error was "InvalidPassword", so provide one try { pDocument->SetPassword( pdfPwd ); return; } catch ( PdfError error ) { error.PrintErrorMsg(); } } Output: PoDoFo encounter an error. Error: 31 ePdfError_InvalidPassword Error Description: The password used to open the PDF file was invalid. Callstack: #0 Error Source: E:\SVN\research\PDFCrypt\Libraries\_podofo-0.9.3\src\ba se\PdfParser.cpp:1148 Information: Authentication with user specified password failed. I can provide the file and password, but I guess I shouldn't append it to the mail, should I? Best regards, F.E. -- Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! https://ad.doubleclick.net/ddm/clk/302982198;130105516;z___ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users