Hello
I get an exception error when decrypting a password protected PDF file using PDF Creator 3.03. It is thrown by the function Encrypt()
The error message is
System.Runtime.InteropServices.SEHEException: External component has thrown an exception.
At CWnd.InvokeHelper(CWnd*, Int32, UInt16, UInt16, Void*, Byte *)
At CPdfcreactivex.Encrypt()
Here is what I do to decrypt the PDF file and save it
m_pdf is an ActiveX in my MFC application
m_pdf.Open(strURL, “123”); //Open password protected PDF with its password 123
try
{
m_pdf.Encrypt("", "", 0); //decrypt file
}
catch (System::Exception ^ e)
{
::AfxMessageBox(CString(e->ToString())); //display exception message
}
m_pdf.Save(newLocation, 1); //save to newLocation
Can someone help me?
Thanks
[Solved] Decrypting PDF throws an exception error in Creator
Re: Decrypting PDF throws an exception error in Creator 3.03
Hello
Your code for decrypting the file is correct.
You need to check that you are using the Owner Password to open the file.
If you open the document using the User Password and the option "Changing the document" is not enabled, you will encounter the problem you mentioned.
Hope that helps?
David
Your code for decrypting the file is correct.
You need to check that you are using the Owner Password to open the file.
If you open the document using the User Password and the option "Changing the document" is not enabled, you will encounter the problem you mentioned.
Hope that helps?
David
Amyuni Custom Development
Do you need a specific PDF solution? Are you looking for expertise that will enable you to start or complete a PDF integration project?
http://www.amyuni.com/en/company/services.php
Do you need a specific PDF solution? Are you looking for expertise that will enable you to start or complete a PDF integration project?
http://www.amyuni.com/en/company/services.php
Re: Decrypting PDF throws an exception error in Creator 3.03
After doing the following, I still get the same exception error with a USER's password
m_pdf.Open(strURL, “123”); //Open password protected PDF with its USER's password 123
try
{
m_pdf.Encrypt("", "", 0xFFFFFFC0 + 8 ); //decrypt file, "Changing the document" is enabled?
}
catch (System::Exception ^ e)
{
::AfxMessageBox(CString(e->ToString())); //display exception message
}
m_pdf.Save(newLocation, 1); //save to newLocation
I have tried with an owner's password, it decrypts with no problem.
How to correctly enable the option "Changing the document" when the only password available is a USER's password?
m_pdf.Open(strURL, “123”); //Open password protected PDF with its USER's password 123
try
{
m_pdf.Encrypt("", "", 0xFFFFFFC0 + 8 ); //decrypt file, "Changing the document" is enabled?
}
catch (System::Exception ^ e)
{
::AfxMessageBox(CString(e->ToString())); //display exception message
}
m_pdf.Save(newLocation, 1); //save to newLocation
I have tried with an owner's password, it decrypts with no problem.
How to correctly enable the option "Changing the document" when the only password available is a USER's password?
Re: Decrypting PDF throws an exception error in Creator 3.03
A User's password doesn't decrypt the PDF file. This is unethical Only owners have the right to decrypt a document
Custom Brand the Amyuni PDF Printer Driver http://www.amyuni.com/en/developer/branding/index.html
Amyuni PDF Converter tested for true PDF performance. View results - http://www.amyuni.com/benchmark
Amyuni PDF Converter tested for true PDF performance. View results - http://www.amyuni.com/benchmark
Re: Decrypting PDF throws an exception error in Creator 3.03
I see, thank you for your help.