Doconvert() method throwing exception

Hi,

The doconvert method throws exception for couple of pdf files. The exception is "The input file was encrypted and no or invalid password has been specified."

But the file is not encrypted.

The code is given below :

pdfConverter.BindPdf(fileName);

pdfConverter.DoConvert(); - this line throws exception.
using (MemoryStream ms = new MemoryStream())
{
pdfConverter.GetNextImage(ms, System.Drawing.Imaging.ImageFormat.Png);
ms.Flush();
returnValue = ms.ToArray();
}

This is the exception detail:

Aspose.Pdf.Kit.PdfKitErrorCodeException: The input file was encrypted and no or invalid password has been specified.
at x30a678191d9b1780.x573da502a3364b6b.x5b81632e5b71b64c(Int32& x67a39b7274cec48f, Int32 x5c4ff2905d409caf, Int32 x820562bfe91b4e71, ImageFormat x0d9146d51b0e6ca4, Int32 x76cfa4602af6a972, Int32& x39b5532b4ddc40a3)
at Aspose.Pdf.Kit.PdfConverter.xaf6adc9ec3dfd936()

Please let me know if it is an issue.

Thanks & Regards,
Sunil.

Hi Sunil,


Thanks for using our products.

Can you please share the source PDF files causing this problem so that we can test the scenario at our end. We are sorry for this inconvenience.

Hi,

I’ve attached the pdf which is having this issue.

Thanks,
Sunil.

Hi Sunil,


Thanks for sharing the resource file.

I have tested the scenario using Aspose.Pdf for .NET 8.0.0 and I am unable to notice any problem during conversion process. Can you please try using the latest release version and in case the problem still persists, please share some details regarding your working environment.

[C#]

//create PdfConverter object<o:p></o:p>

PdfConverter objConverter = new PdfConverter();

//bind input pdf file

objConverter.BindPdf("c:/pdftest/grade+report.pdf");

//initialize the converting process

objConverter.DoConvert();

//check if pages exist and then convert to image one by one

while (objConverter.HasNextImage())

objConverter.GetNextImage("c:/pdftest/grade+report"+DateTime.Now.Ticks.ToString() + ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg);

//close the PdfConverter object

objConverter.Close();



Please note that since July-2011, Aspose.Pdf.Kit for .NET has been discontinued as a separate product and all its classes and enumerations are merged under Aspose.Pdf.Facades namespace of Aspose.Pdf for. NET. For further details, please visit

thanks a lot, the new version has fixed the issue.

Hi Sunil,


I am glad to hear that your problem seems to be fixed in latest release version of Aspose.Pdf for .NET. Please continue using our product and in the event of any further query, please feel free to contact.