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

Free Support Forum - aspose.com

Exception when saving doc: Reference table is not repaired

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?

@cornelos

Thanks for contacting support.

Would you please share a sample PDF document with which the issue is reproducible. We will test the scenario in our environment and address it accordingly.

You can download the document here: https://drive.google.com/open?id=1gDLi_n8z9B8kyiNQgduaY2ZHhQQTbaTN

@cornelos

Thanks for sharing sample PDF.

We have tested the scenario in our environment and were able to replicate the issue. Therefore, we have logged it as PDFNET-45631 in our issue tracking system. We will further look into details of the issue and keep you posted with the status of its rectification. Please be patient and spare us little time.

We are sorry for the inconvenience.

Has there been any update to this thread? I am seeing the exact same problem in my project when trying to save a document after adding images to pages.

@ryan.coleman

Thank you for contacting support.

The ticket PDFNET-45631 has not been resolved yet. However, would you please create a separate topic while mentioning all the details where you may refer to this topic as well, so that we may investigate the scenario and take care of your concerns.

Has this been resolved yet?
I had this occur with a PDF that was generated BY Aspose PDF 17.4 (PDF version is 1.7). Unfortunately it is confidential so I cannot provide it.

Aspose.PDF will open the file but will not save it after optimization.

Interestingly PDFSharp is unable to open the PDF at all, although Acrobat, PDFium, and iTextSharp are totally fine with it.

My solution has been to use iTextSharp to re-save the PDF as version 1.4. After that, Aspose.PDF is able to handle the file fine.

@peter0302

We are afraid that earlier-logged ticket is not yet resolved. We have recorded your feedback and provided information along with it as well and will look into it during investigation. We will inform you as soon as the ticket is resolved. Please give us some time.

We are sorry for the inconvenience.

Any chance this has been resolved? I am experiencing the same issue. I have attached a copy of one of the PDFs that is having the issue. I am currently using Aspose.Pdf .NET version 18.4.0.0. TestDemo.pdf (47.4 KB)

@puremass

We regret to inform you that the earlier logged ticket is not yet resolved. However, we have recorded your concerns and will surely update you once we have some news about ticket rectification. Please be patient and spare us some time.

We are sorry for the inconvenience.