We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

DoConvert fails with error code '4'

Doing a simple 'DoConvert' fails on this document. Can you help?

Hi Khalid,

I have tested the file with Aspose.Pdf.Kit for .NET 3.8 and noticed that the actual problem you’re facing at your end is that the file is encrypted and PdfConverter is unable to process it. However, I have tried to decrypt the file as below and it worked fine:

Aspose.Pdf.Kit.PdfFileSecurity sec = new Aspose.Pdf.Kit.PdfFileSecurity(“MyTravelPlans.pdf”, “decrypted.pdf”);


Aspose.Pdf.Kit.PdfConverter converter = new Aspose.Pdf.Kit.PdfConverter();



while (converter.HasNextImage())

converter.GetNextImage(DateTime.Now.Ticks.ToString() + “.jpg”);

Please try to decrypt the file first and then convert it to images. Moreover, please download the latest version, so you could see the actual error message, because we have improved the error messaging system in this version.

I hope this helps. If you find any other issues, please do let us know.

Thank you. That took care of it. We added a check using PdfFileInfo to see if it is encrypted before performing the operation. Thanks again for the fast reply.