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

Free Support Forum - aspose.com

'Length cannot be less then zero' exception while trying to convert PDF to any other format

Hello!

While trying to convert PDF file to any other format such as DOC, DOCX, or HTML with such code:

var doc = new Aspose.Pdf.Document(inputFile);
doc.Save(outputFile, Aspose.Pdf.SaveFormat.Html);

I always get an exception at Save method: ‘Length cannot be less then zero’.

Aspose.Pdf for .NET version is 17.8.0.0, Mono version is 4.2.3.4.

@anton.nonko,
Kindly send us your source PDF document for the testing purposes. We will investigate and share our findings with you. Your response is awaited.

Best Regards,
Imran Rafique

Thank you for your answer. How should I send it?

@anton.nonko,
You can attach a Zip to your reply post because there is an upload button in the header of the post editor. Furthermore, you can also upload a file to any free file sharer server, and then share its download URL in the post.

Best Regards,
Imran Rafique

@imran.rafique,
Thank you for the advice. Here’s the file:.hello.pdf (6.1 KB)

Also I’ve found that exception is raised when I’m trying to convert to any format even back to PDF.

@anton.nonko,
Based on the initial investigation, the said error is not reproducible in our environment. We will prepare an environment of Mono framework and share our findings with you in the next week. Please spare us a little time.

Best Regards,
Imran Rafique