Adding watermark to ppt and pptx

Hi,


I want to add watermarks to ppt and pptx files but it seems that there is a problem.

1.) When I add to ppt files FitTextToShape seems to have no effect.
2.) Is there a FitTextToShape for pptx files?

I’ve attached a sample project how I add the watermarks.

Thanks
Wolfgang Raab

Hi Wolfang,

Please visit this thread link for information about adding watermark in PPT/PPTX. Hopefully, it will help you. If you still have issue then please feel free to share with us.

Thanks and Regards,

Hi,


I already know that forum entry but if you have a look at my test project the output does not look as expected!

Thanks
Wolfgang Raab

Hi Wolfgang Raab,

I have worked with the code snippet shared by you and have made necessary changes inside it. Hopefully, it will work for you this time.

Thanks and Regards,

Hi,


sorry but that’s not the output I want!

I’ve added a new attachment with samples of a word document created with aspose.words (thats the way I want the watermark) and the documents I get with your code and the latest version of aspose.slides (5.3.0.0).

Thanks,
Wolfgang Raab
Hi Wolfgang Raab,
I have worked on the requirements shared by you and have shared the modified code snippet with you for your reference. Please share, if you may still have any issue.
Thanks and Regards,

Hi,


thanks now the output looks like as I wanted but you are setting the size of the font to a fixed value. Is there a way to calculate the size for longer watermark texts (or is there a autofix)? At the moment the text would overlap the slide.

Thanks,
Wolfgang Raab

Hi Wolfgang Raabv,

I regret to share that any option like autofix the text size based on shape size is not available in Aspose.Slides. The mechanisms that I have shared is in fact the allowed and legal way to implement it.

Thanks and Regards,

Hi Team i wanna implement water mark for ppt slides. Could you please share code for it?

Thanks in advance!!

@vikramreddyg,

I have observed your requirements and like to share that Aspose.Slides allows feature to lock shapes in slide that you can use to add watermark. You can add watermark shape on master slide and then apply locks on that as given in following sample code. You may do formatting of watermark text as per your requirements.

public static void AddWatermarkShape()
{
    Presentation pres = new Presentation();
    IMasterSlide master = pres.Masters[0];
    IAutoShape ashp = master.Shapes.AddAutoShape(ShapeType.Rectangle, 10, 10, 300, 300);
    ashp.AddTextFrame("This is watermakr");
    ashp.TextFrame.Paragraphs[0].Portions[0].PortionFormat.FontHeight = 25;
    master.Shapes.Reorder(0, ashp);
    ashp.ShapeLock.SelectLocked = true;
    ashp.ShapeLock.SizeLocked = true;
    ashp.ShapeLock.TextLocked = true;
    ashp.ShapeLock.PositionLocked = true;
    ashp.ShapeLock.GroupingLocked = true;

    pres.Save("C:\\Aspose Data\\watermark.pptx", Aspose.Slides.Export.SaveFormat.Pptx);

}

I hope the share solution will be helpful.