When converting a PDF to HTML, some PDF documents cause an error when calling the Save method.
An example of the exception returned.
Object reference not set to an instance of an object.
at .( , TTFFont , , GlyphID[] , )
at . ( , , )
at .( , List1 ) at .( , List
1 )
at . ( , List`1 )
at . ( , , )
at .(Document , & , UnifiedSaveOptions , Int32& )
at .(Document , String , Stream , HtmlSaveOptions )
at Aspose.Pdf.Document.Save(String outputFileName, SaveOptions options)
at pdftohtmlinspector.PdfInspector.ProcessSelectedPDF()
I just finished testing with version 17.8.0 of the aspose.pdf.dll and the issue is still reproduce-able.
I have attached 2 PDFs that may demonstrate the issue.
win7error.pdf causes an error on windows 7 professional. The stack trace above came from that document.
prodError.PDF causes an error in the production environment. I am not sure what the OS is there but i believe it is server 2008r2.
This document returns the following error.
reference not set to an instance of an object.Object reference not set to an instance of an object. at Aspose.Fonts.CFF.CFFFontMetrics.get_FontMatrix()
at Aspose.Fonts.CFF.CFFFontMetrics.get_UnitsPerEM()
at . ( , , )
at .( , List1 ) at .( , List
1 )
at . ( , List`1 )
at . ( , , )
at .(Document , & , UnifiedSaveOptions , Int32& )
at .(Document , String , Stream , HtmlSaveOptions )
at Aspose.Pdf.Document.Save(String outputFileName, SaveOptions options)
Neither of these documents cause an error when running on windows 10.
prodError.PDF (386.3 KB)
win7error.pdf (845.0 KB)