We’re using Aspose.PDF 22.12.0 and getting the following error.
System.Exception: Object not found —> System.ApplicationException: Reference table is not repaired — End of inner exception stack trace — at #=zYRxVgF$EdJl9PWeZQPpZhnv2V9Tu.#=zXcM$QEQ=(#=zkc9cTjaMDfbWOww0Oky8Gq4q_RTFT5BOXw== #=z19AYD4w=, Boolean #=zZ6T5bkiEANPN) at #=zYRxVgF$EdJl9PWeZQPpZhnv2V9Tu.#=zXcM$QEQ=(#=zkc9cTjaMDfbWOww0Oky8Gq4q_RTFT5BOXw== #=z19AYD4w=) at #=zgqGhah1dgAE46Dt8kUCnKTRs2kf9Xpne0w==.#=zfmRXUu4=(Document #=zrGw8gRA=) at #=zl_gt7NJPZVQIlJoijwc6xJ5gLd3B.#=z1AuJE0M=(OptimizationOptions #=zup3hSDc=) at Aspose.Pdf.Document.OptimizeResources(OptimizationOptions strategy)
Code below:
`using (MemoryStream saveStream = new MemoryStream())
{
var optimizationOptions = new Aspose.Pdf.Optimization.OptimizationOptions();
optimizationOptions.ImageCompressionOptions.CompressImages = CompressImages;
if (CompressImages)
{
optimizationOptions.ImageCompressionOptions.ImageQuality = ImageQuality;
optimizationOptions.ImageCompressionOptions.ResizeImages = ResizeImages;
if (ResizeImages)
{
optimizationOptions.ImageCompressionOptions.MaxResolution = MaxResolution;
}
}
optimizationOptions.ImageCompressionOptions.Version =
GetCompressionVersion(ImageCompressionVersion);
optimizationOptions.LinkDuplcateStreams = LinkDuplicateStreams;
optimizationOptions.AllowReusePageContent = AllowReusePageContent;
optimizationOptions.UnembedFonts = UnembedFonts;
doc.OptimizeSize = true;
doc.OptimizeResources(optimizationOptions);
doc.Save(saveStream);
resultBytes = saveStream.GetBuffer();
}`
I noticed other topics around this but they haven’t been updated or have appeared to be an issue in a long time.
The PDF I’m using can be found here