Removing Comments from a Presentation in Java Throws PptxReadException

Hi @Andrey_Potapov,

We were able to remove the comments from the presentations using the aspose-slides version 22.2. However this change has now introduced a new bug in our conversion. We are now getting following error while conversion:

class com.aspose.slides.PptxReadException: Can’t find the shape with shape id = 6147. —> class com.aspose.slides.exceptions.Exception: Can’t find the shape with shape id = 6147.
com.aspose.slides.ac1.do(Unknown Source)
com.aspose.slides.ac1.do(Unknown Source)
com.aspose.slides.apv.for(Unknown Source)
com.aspose.slides.apv.do(Unknown Source)
com.aspose.slides.akm.do(Unknown Source)
com.aspose.slides.aj5.byte(Unknown Source)
com.aspose.slides.aj5.do(Unknown Source)
com.aspose.slides.Presentation.if(Unknown Source)
com.aspose.slides.Presentation.do(Unknown Source)
com.aspose.slides.Presentation.if(Unknown Source)
com.aspose.slides.Presentation.(Unknown Source)
com.aspose.slides.Presentation.(Unknown Source)
com.gartner.cpp.fileconverter.converter.PPTConverter.convert(PPTConverter.java:35)
com.gartner.cpp.fileconverter.service.ConvertService.convertFile(ConvertService.java:71)
com.gartner.cpp.fileconverter.service.ConvertService$$FastClassBySpringCGLIB$$ee81774c.invoke()
org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:783)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
org.springframework.retry.interceptor.RetryOperationsInterceptor$1.doWithRetry(RetryOperationsInterceptor.java:97)
org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:329)
org.springframework.retry.support.RetryTemplate.execute(RetryTemplate.java:225)
org.springframework.retry.interceptor.RetryOperationsInterceptor.invoke(RetryOperationsInterceptor.java:122)
org.springframework.retry.annotation.AnnotationAwareRetryOperationsInterceptor.invoke(AnnotationAwareRetryOperationsInterceptor.java:163)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:698)
com.gartner.cpp.fileconverter.service.ConvertService$$EnhancerBySpringCGLIB$$64dc9c8a.convertFile()
com.gartner.cpp.fileconverter.controller.FileConversionController.lambda$convertAsync$0(FileConversionController.java:69)
*java.base/java.lang.Thread.run(Thread.java:834) *
— End of inner exception stack trace —com.aspose.slides.aj5.do(Unknown Source)
com.aspose.slides.Presentation.if(Unknown Source)
com.aspose.slides.Presentation.do(Unknown Source)
com.aspose.slides.Presentation.if(Unknown Source)
com.aspose.slides.Presentation.(Unknown Source)
com.aspose.slides.Presentation.(Unknown Source)
com.gartner.cpp.fileconverter.converter.PPTConverter.convert(PPTConverter.java:35)
com.gartner.cpp.fileconverter.service.ConvertService.convertFile(ConvertService.java:71)
com.gartner.cpp.fileconverter.service.ConvertService$$FastClassBySpringCGLIB$$ee81774c.invoke()
org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:783)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
org.springframework.retry.interceptor.RetryOperationsInterceptor$1.doWithRetry(RetryOperationsInterceptor.java:97)
org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:329)
org.springframework.retry.support.RetryTemplate.execute(RetryTemplate.java:225)
org.springframework.retry.interceptor.RetryOperationsInterceptor.invoke(RetryOperationsInterceptor.java:122)
org.springframework.retry.annotation.AnnotationAwareRetryOperationsInterceptor.invoke(AnnotationAwareRetryOperationsInterceptor.java:163)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:698)
com.gartner.cpp.fileconverter.service.ConvertService$$EnhancerBySpringCGLIB$$64dc9c8a.convertFile()
com.gartner.cpp.fileconverter.controller.FileConversionController.lambda$convertAsync$0(FileConversionController.java:69)
java.base/java.lang.Thread.run(Thread.java:834)

Could you please help us let know what is the possible cause of this failure? Is this is a known issue on slides? Any insight on this would be helpful.

NOTE: Feel free to create a different thread or topic if you feel this issue is unrelated to the current thread.

Thanks

1 Like

Additional important note to the previous post. This issue is not happening if we switch back to version 21.10, but then the removal of comments doesn’t work.

@suming.li,
Thank you for contacting support. To test the case you are experiencing, please share the following data and information:

  • presentation file
  • code example that reproduces the error
  • OS version where the code was executed
  • JDK version in your app

Hi @Andrey_Potapov,

We are using jdk11 and testing this on Windows 10 Enterprise. Here is the code snippet we are using to test the conversion.

    Presentation presentation = new Presentation(
				"<path to file>\\Issue_session.pptx");
		try {

			/*
			 * for (ICommentAuthor author : presentation.getCommentAuthors()) {
			 * author.getComments().clear(); }
			 */

			presentation.save("TestOutput.pptx", SaveFormat.Pptx);
			System.out.println("Done processing");
		} finally {
			if (presentation != null)
				presentation.dispose();
		}

Note: We have 1 comment thread in the presentation I have shared and if you remove that, code will run fine without any errors. The code fails even when the snippet to remove the comments is commented-out. I believe, there is an issue while we read/load the comments in the presentation.

Please let me know, if you need any further information to look into the issue.
Attachment: Issue_session.7z (217.5 KB)

@suming.li,
Thank you for the additional information. I’ve done some testing and am glad to inform you that the issues you are experiencing are already resolved in newer versions of Aspose.Slides (the sample code works fine with/without comment removal in version 22.8). Please use the latest version of Aspose.Slides if it is possible.

You can also quickly check your results using Free Annotation Removal App for PowerPoint. It works based on the latest version of Aspose.Slides.

Hi @Andrey_Potapov,

I am not sure if there is any thing I am missing from code/config perspective, but it doesn’t work for me with the version upgrade to 22.8. It throws the same exception.

@suming.li,
Please test your results using a simple standalone project. If the issue persists, please share the project here. We would also appreciate any additional information that would help us reproduce the error on our end.

Hi @Andrey_Potapov,

As per you suggestion, we have tried converting the presentation using a standalone project using version 22.8. I am not seeing the shape error anymore with selected sample files but one of the presentation file fails while removing the comments. This the error I get:

Exception in thread “main” class com.aspose.slides.PptxReadException: Comment reply by nonexistent author. AuthorId = 0a0f10f2-d1bf-a338-b8a1-99eec8b2fed2. —> class com.aspose.slides.exceptions.Exception: Comment reply by nonexistent author. AuthorId = 0a0f10f2-d1bf-a338-b8a1-99eec8b2fed2.

Attaching the sample file for your reference.test_comment_removal1.7z (3.9 MB)

@suming.li,
Thank you for the additional information. I’ve reproduced the same error with Aspose.Slides 22.8 but the exception does not appear in Aspose.Slides 22.10. Please use the latest version of Aspose.Slides.

Thanks @Andrey_Potapov. It worked with the latest version. Let me go back and validate few other presentations that were not converted successfully.
I believe that should work fine with the latest version now.

@suming.li,
We will be waiting for your feedback.