When I read the document attached document, optimize it and save it again I get an exception:
System.Exception
HResult=0x80131500
Message=Object not found
Source=Aspose.PDF
StackTrace:
at . ( )
at . (Int32 , Int32 )
at . ()
at . ()
at . ()
at .()
at .( , Boolean )
at .( , Boolean )
at . ( , )
at . (Stream )
at . (Stream )
at Aspose.Pdf.Document.(Stream , SaveOptions )
at Aspose.Pdf.Document.(String )
at IntraOffice.PostOffice.Portal.Service.Helpers.DocumentHelper.<PrepareDocumentAsync>d__5.MoveNext() in C:\Development\Repositories\IntraOffice_94\Source\IntraOffice.PostOffice.Portal.Service\Helpers\DocumentHelper.cs:line 216
Inner Exception 1:
ApplicationException: Reference table is not repaired
This is what I do:
var document = new Aspose.Pdf.Document(“test.pdf”);
document.Optimize();
document.Save(“test-optimized.pdf”);
I can reproduce this with version 18.10
Can you please explain why this is happening?