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

Free Support Forum - aspose.com

Shapes incorrectly positioned when converting slide to PNG

I am using aspose-slides:jdk16:17.8 to convert .ppt and .pptx slides to PNG images for my web application.

In most cases the conversion works well. However, I have several slides that contain shapes, lines and text that, when converted to PNG image, appear in different positions than the original slides.

Example 1:
Contiq_example_1.pptx - original document containing one slide with all shapes in their correct locations
Contiq_example_1.pptx.zip (506.8 KB)
Contiq_example_1.png - converted PNG image with shapes not in the correct location with respect to original
Contiq_example_1.png (20.3 KB)

Example 2:
Contiq_example_2.pptx - original document containing one slide with all shapes in their correct locations
Contiq_example_2.pptx.zip (765.6 KB)
Contiq_example_2.png - converted PNG image with shapes not in the correct location with respect to original
Contiq_example_2.png (66.7 KB)

@rahul.contiq,

I have observed the information shared by you and have verified the presentation decks on my end using Aspose.Slides for Java 18.3. I have not been able to observe the issue on my end. I suggest you to please try using the suggested version on your end.

Contiq_example_1_0.jpg (27.3 KB)
Contiq_example_2.jpg (83.4 KB)

I have rebuilt our application using the aspose-slides v18.3 from the location https://repository.aspose.com/repo/com/aspose/aspose-slides/

Unfortunately when I extract the slide for contiq_example_1.pptx and convert it to png I don’t get the desired result. Consider the attached file which is a PNG output from v18.3.

I also not that your examples are JPG output. Could this be the reason for the difference?

Otherwise I am not sure what else to do to fix the issue.Contiq_example_1_v18-3.png (36.9 KB)

@rahul.contiq,

Can you please share the sample code that you have used on your end for thumbnail creation along with Operating System and Java details used.

Running on Amazon linux instances.

			this.logInfo(String.format("Creating PNG for slide %d of document %d", index, documentId));

			buffer = com.contiq.common.aspose.Utils.toPNG(slide, 2F);

			this.logInfo(String.format("Completed creation of PNG for slide %d of document %d", index, documentId));

			if (pngStore == null)
				pngStore = this.factory.createFileStore(ContentType.png);

			this.logInfo(String.format("Uploading PNG for slide %d of document %d", index, documentId));

			pngStore.save(buffer, itemKey);

			this.logInfo(String.format("Completed uploading PNG for slide %d of document %d", index, documentId));

@rahul.contiq,

As requested earlier, can you please share the Java details used on your end as well. Secondly, I have observed from your code that you have used Aspose.Slides in your own custom way and I am unsure whether the custom mechanism has any implications or not. Therefore, I suggest you to please try using this sample code in a separate Java console application and verify the results. If there is still an issue then please share the Java JDK details used on your end along with a working sample project reproducing issue. Unfortunately, from above shared portion of code, I am unable to use that on my end.

Java JDK 1.8 (Java 8)

@rahul.contiq,

As per our suggestion, did you try using sample console Java application on your end. Also, I have requested for following information. Can you please share that.