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

Free Support Forum - aspose.com

How can I insert watermark in every page

I use the JAVA language.
and I want to insert watermark(image) in every slide page.
I found only a way to use the loop. (after getting the each slide)
Is there a way to put background images(watermark) at once?
If it is possible, could you give me a sample code ?


I have observed your requirements and suggest you to please try using following sample code to insert watermark.

public static void TestWatermark()

        Presentation presentation = new Presentation();

        for (ISlide slide : presentation.getSlides())

            IAutoShape shape = slide.getShapes().addAutoShape(ShapeType.Rectangle, 700, 100, 200, 80);
            slide.getShapes().reorder(0, shape);

            ITextFrame textFrame = shape.addTextFrame(" ");

            IPortion portion = textFrame.getParagraphs().get_Item(0).getPortions().get_Item(0);//.PortionFormat;

            portion.setText( “Test Frame…water mark”);

            portion.getPortionFormat().getFillFormat().setFillType (FillType.Solid);

            java.awt.Color col= new java.awt.Color(255,0,0,30);
            //System.Drawing.Color.FromArgb(30, System.Drawing.Color.Silver)

        presentation.save(“D:\\Aspose Data\\Dest.pptx”, SaveFormat.Pptx);   
1 Like

I use the backgroud image.
How can I change the background image size?
and set the background image’s opacity?

I use below code.

public static void main(String[] args){
String pptPath = “c:\aspose\watermarkTest.pptx”;

	// load the file to be rendered
	Presentation pres = new Presentation(pptPath);
	// Set the background with Image
	// set the pictrue
	IPPImage imgx = null;
		imgx = pres.getImages().addImage(new FileInputStream(new File("c:\\watermark_big.gif")));
	}catch(Exception e){
	// Add image to presentation's images collection
	pres.save("c:\\aspose\\watermark.pptx", SaveFormat.Pptx);


I have observed your following requirement

The slide background is set for entire slide size. However, you can add a picture frame your self and set the size of picture frame that can hold the image. This is possible option is to add PictureFrame and set the size accordingly.

I regret to share that there is no option to set image opacity in PowerPoint and Aspose.Slides. However, you can using any third party or Aspose.Imaging to set the opacity of image to be added and then add that in PowerPoint picture frame as above.

Thank you for your answer.
I’ll try to solve it.

Thank you very much:heart: