Free Support Forum - aspose.com

Invalid PDF format hangs for 5 minutes or so

I have a pdf file attached that just hangs on the following line:

while (convPDF.HasNextImage())

After about 5 minutes I get the error message:

Error: Wrong conversion, please check your pdf.

Is there anyway to check the file for a proper format before trying to get the next image? Here’s the whole snippet:

convPDF = new PdfConverter();
convPDF.BindPdf(sPath);
convPDF.DoConvert();
MemoryStream ms = new MemoryStream();

convPDF.StartPage = intPage;
convPDF.EndPage = intPage;

while (convPDF.HasNextImage())
{
convPDF.GetNextImage(ms, System.Drawing.Imaging.ImageFormat.Bmp);
bmp = (Bitmap)System.Drawing.Image.FromStream(ms);
}

THANKS!


This message was posted using Page2Forum (attachment) from Aspose.Words for .NET and Java - Documentation

Hi Larry,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I will move your post to the Aspose.Pdf.kit Product Family Forum so they can better help you with this issue.

Thanks,

Hi Larry,

I have tested this file using the latest version, which will be published tomorrow, and it worked fine. Please try using our latest version once it is released. If you still find the same problem, please do let us know.

We’re sorry for the inconvenience.
Regards,