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

Free Support Forum - aspose.com

How to compare two masters using Aspose

Hey there,
While applying templates we want to compare whether the master in template already exists in presentation document on the basis of formatting associated with master, layouts associated with the masters. How can we do the comparison for the masters present in different documents?

Hi Praneeth,


I have tried observing your requirement and have not completely understand that what actually you want Aspose.Slides to offer you in your scenario. All Aspose.Slides offers is that there is master slide and there are layout slides inside that master. Every layout slide has a type. There is no comparison mechanism available in Aspose.Slides to compare two masters. Only the above information is available that you may use on your end and devise a logic for comparison between two masters. But you need to understand that what information is available and is that information is fulfilling your need of comparison ?

Many Thanks,

Hi Mudassir,
Thanks for looking into this. If we can’t compare masters directly we will then try to compare at layout level. Could you please suggest us how to compare two layouts of same type? We assume layouts are identifiable by layout types? We want to compare all attributes associated with layouts such as - themes (font, color, effects), headers footers, background styles. Thanks.

Hi Praneeth,

I regret to share that there is no approach available in this regard to compare the attributes of layout slides automatically. You have to devise your own mechanism in this regard to compare attributes of two layout slides of same types but belonging to different masters. Actually, the masters are used as template presentations and one refer to the layout slides inside desired master using Aspose.Slides in the presentation. The best place to design the template with masters is PowerPoint. Once you create the master, you can apply that on your slides. When you change the slide master slide and if the type of layout slide that your desired slide has is available in new master, the master gets applied on that. You may need to devise the mechanism on your end if you really wish to make comparison using Aspose.Slides. However, as suggested earlier the best place for such comparisons is PowerPoint.

Many Thanks,

Can you suggest us how to proceed for the layout comparison or can you raise the ticket for the same? Thanks for looking into this.

Hi Praneeth,

I have created an issue with ID
SLIDESJAVA-34726 in our issue tracking system to investigate the possibility of implementing the support for comparing master and layout slides. I also like to add further here that this is one complex implementation that needs immense resources for implementation. We will share the good news with you as soon as the issue will be resolved.

Many Thanks,

Hi Mudassir,

I’m just discussing, please don’t add the thread in enterprise support until I confirm with you again. If we decide to add this task (master comparator) in enterprise support, what will be expected time-frame for this to be completed? Would this feature be available in next version release? Thanks.

Hi Praneeth,

I like to share that this feature is a big and complex task. At present we don’t even have support for themes in Aspose.Slide and that too is likely to be available during Q2 of 2015. If you consider this issue to be resolve with enterprise priority level then it may get expedite a little but will certainly will not be possible in coming or next coming release. However, our development team has scheduled the issue for initial investigation and estimation for ETA by end of Week 09/2015. After that, we will be able share the tentative time line for the feature availability.

Man Thanks,

Hello Mudassir,

Do you have any update on the same? We need to compare two MASTERS, say M1 of document1 with M1 of document2 to see if those are same in terms of master and layout attributes.

Hi Praneeth,

I have discussed with our development team and like to share that support for comparing masters involves much of work and is a complex implementation. At present we are unable to provide the requested support but it will be included by Q4 of 2015. We will share the feedback with you as soon as the support will be available.

Many Thanks,

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan

@PraneethS,

Now by using latest, Aspose.Slides for Java 20.6, you have provision to compare the presentation files not only presentation levels but can also 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
            if(Src1Pres.equals(Src2Pres))
            {
                    System.out.println("Two Presentation files are equal");
            }

            //Comparing Master slides
            if(Src1Pres.getMasters().get_Item(0).equals(Src2Pres.getMasters().get_Item(0)))
            {
                    System.out.println("Masters are equal.");
            }

            //Comparing Layout slides
            if (Src1Pres.getMasters().get_Item(0).getLayoutSlides().get_Item(0).equals(Src2Pres.getMasters().get_Item(0).getLayoutSlides().get_Item(0)))
            {
                    System.out.println("Layout are equal.");
            }

            //Comparing Normal slides
            if (Src1Pres.getSlides().get_Item(0).equals(Src2Pres.getSlides().get_Item(0)))
            {
                    System.out.println("Slides are equal.");
            }

    }