Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

Password Protected PDF documents

$
0
0

Hi,

I am using Aspose.Pdf product to open the password protected pdf documents. But my current requirement is to loop the list of passwords until the document open with correct password. please provide me the same code for this.

PdfFileInfopdfFileinfo = null;

try

         {

            pdfFileinfo = new PdfFileInfo(stream);

}

catch (Exception ex)

{

            throw new Exception(string.Format("Unable to open the PDF file.\n<Error>: {0}", ex.Message));

         }

if (pdfFileinfo.IsEncrypted)

{

pdfFileinfo = new PdfFileInfo(stream, "Password-1");                                 

}

Thanks,

Dhivya


Viewing all articles
Browse latest Browse all 3131

Trending Articles