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

Free Support Forum - aspose.com

Aspose.Pdf.Exceptions.InvalidPdfFileFormatException: Incorect file format

Hi, we’ve been using Aspose.Pdf for several years. Our application has thrown this error, and I’m looking for clues on how to trouble shoot. What sort of runtime conditions would cause the InvalidPdfFileFormatException to be thrown… here’s the stack trace (application calls omitted)

Unhandled exception Caught: ML.Uspct.Sbl.Lma.Common.LmaDataException: Code: Description: Aspose.Pdf.Exceptions.InvalidPdfFileFormatException: Incorect file format
at .?.(String[] , String[] , Boolean )
at ...(? , ?& )
at .?.(? , ?& )
at .?..ctor(Stream , String , Boolean )
at .?..ctor(Stream )
at ..(Stream )
at Aspose.Pdf.Document.(Stream , String )
at Aspose.Pdf.Facades.Form.set_SrcFileName(String value)


Thanks for contacting support.

Such exceptions are expected when an invalid or corrupted PDF document or memory stream containing file data is supplied to Document constructor. In case you are facing such exception with specific PDF document which is able to be opened in Adobe Reader, you can please share that with us along with sample code snippet. We will test the scenario in our environment and address it accordingly.