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

Free Support Forum - aspose.com

Image not added on all master slides

Hello,


I am trying to simulate a watermark in the best possible way. For that, I am adding a generated image with my text on each master slide.

There are two problems:

1. I have found a file on which the image is not added on all master slides.
I am using the following code:

foreach (Aspose.Slides.MasterSlide sld in pres.Masters)
{
//Add Picture Frame with height and width equivalent of Picture
sld.Shapes.AddPictureFrame(Aspose.Slides.ShapeType.Rectangle, 0, 0, imgx.Width, imgx.Height, imgx);
}

2. Some images are in front of the watermark image from the master slide.

I think the master slides layers are below the images that are added to the actual slide. I thought that it would be a much more efficient way to add the watermark on each master slide, because if you add it on each slide on a file with 1600 slides for example, well the performance wouldn’t be so good.

I have noticed that I use the slides library without a license, some kind of watermark is applied on each slide to inform the user that it was done with an evaluation version from aspose, and that info shows over anything from the slides. I think that is added on each slide. Am I right?

How can I add the image so it can be on front of everything? Could I do that from the master slides?

I have attached a small example project that reproduces my issue.

Thank you,

Dan

I

Hi Dan,

I have worked over the requirements shared by you. Actually, both requirements shared are not issues with Aspose.Slides and one need to understand the concept behind the occurrence of undesired output. For your first point where you have stated that you have added image on master level and it is not added on all master slides. I like to share that you have one presentation master and there are layout slides in that master. So, when you add an image on master level, it will get replicated on those layout slides that are created in accordance with master and are not custom made. In your case, when you apply the image on master slide it is followed by those layout slides that are in accordance with master. Since it is a chain reaction, so the presentation slides that are in accordance with layout slides show the watermark image for those slides for which the respective layout slide has watermark image in it. In order to rectify this one can add image watermark image on every layout slide of master independently.

One more issue that I observed in your implementation for setting watermark is ZOrder of the watermark image. The watermark image has to be in front of all the shapes.So, you need to set the ZOrder position of picture frame to max position so that it should always be visible on front. The modified sample code will help you in this regard.

Now, there is one more point to consider here. If a slide added in presentation exactly follows the layout slides then it will always show the watermark in front of every shape on that slide. However, when you add some new custom shape (e.g. picture, text frame) on a slide then in that case the newly added shapes on that slides will come ahead of watermark image . This is logical as well because you have set the watermark image in layout slide and its ZOrder position to be maximum. When you add a new slide that follow some particular layout, it will inherit the all shapes from layout slide. When you will add a new shape to that slide, the newly added shape will get ahead in order of previous maximum shape (Watermark image). So, in this case it is advisable to add the watermark explicitly for such slides that have some extra shapes in them apart from the layout slide shapes.

I hope this will clarify the concept to you. Please share, if I may help you further in this regard.

Many Thanks,

Hello,


Thank you for your support as it helped me solve my issue.

Thank you,

Dan