I want to compare the two presentations in the following way:
- It will check whether presentation having the same number of slides or not
- It will check the master slides and properties of slides like background color, title, the layout of slides, etc.
- It will check the content like text present in the slides, the properties of text(font size, color,etc.)
- It will check the images, shapes, etc.
I try this method but it’s not meeting the expectations https://docs.aspose.com/display/slidesjava/Changing+a+Slide’s+Layout#ChangingaSlide%27sLayout-Comparetwoslides
Can you please share source files so that we may further investigate to help you out.
I am testing the code in slides-java-example the same repo which is shared by ASPOSE team for reference. In this project, I just put my code inside the CheckSlidesComparison class. The changed code get from attachment. CheckSlidesComparison.txt.zip (735 Bytes)
Using this method it’s not giving false in the following cases:
- Colour change of text or shape
- Font size changes
- Font style changed to underline
- Theme changes
- One shape changed to another shape
- Text change inside the shape like in round shape if I have 1 and in the second slide it has 2 in round shape then it’s not taking it as different
- Remove image from header
I have observed the sample code shared by you and regret to share that at present there is no support available in API to compare two slides. One may need to devise his own approach to individually check each and every shape belonging to a particular slide along with all of its respective properties.
Thanks @mudassir.fayyaz for quick response.
Using latest, Aspose.Slides for Java 20.6, now you can compare the presentation files not only presentation levels but also have provision to compare master slides, layout slides and individual slides. Please refer to following example for usage of the supported feature.
public static void ComaprePresentationSlides()
Presentation Src1Pres = new Presentation("Src1.pptx");
Presentation Src2Pres = new Presentation("Src2.pptx");
//Comparing on presentation level
System.out.println("Two Presentation files are equal");
//Comparing Master slides
System.out.println("Masters are equal.");
//Comparing Layout slides
System.out.println("Layout are equal.");
//Comparing Normal slides
System.out.println("Slides are equal.");