Hi ,
I am using Aspose.pdf.dll 9.1
Please find the attached pdf file and by using the below code it is return as the PDF is password protected.
public static bool IsPDFPasswordProtected(string FileName)
{
bool isPassProtected = false;
PdfFileInfo fileInfo = new PdfFileInfo(FileName);
return isPassProtected = fileInfo.IsEncrypted;
}
But i can able to open the pdf without password.
Can you please help me on this . Because it is urgent.
Regards
Anish
Hi Anish,
Hi Tilal,
But while opening the PDF it is directly opening with out asking the password.
So our customer is asking why it is problem while converting?
Regards
Anish
Hi,
Is there any way to avoid to check owner password while checking whether the file is protected?
Regards
Anish
anishvj:
But while opening the PDF it is directly opening with out asking the password.
So our customer is asking why it is problem while converting?
Document pdfDocument = new Aspose.Pdf.Document(myDir + "PasswordProtected.pdf","ownerpassword");
Best Regards,
anishvj:Hi,
Is there any way to avoid to check owner password while checking whether the file is protected?
Regards
Anish
PdfFileInfo pdfFileInfo
= new PdfFileInfo(myDir+“Leonard Martin Guardian 2014.pdf”);<o:p></o:p>
if (pdfFileInfo.HasOpenPassword )
Console.WriteLine("The given PDF file is password protected and has open password.");
if (pdfFileInfo.HasEditPassword)
Console.WriteLine("The given PDF file is password protected and has owner password.");
Please feel free to contact us for any further assistance.
Best Regards,