I have observed your sample code and suggest that you need to set the watermark on master slide and all subsequent slides using that master will have watermark on that. I suggest you to please try using following sample code on your end. I have attached the generated presentation as well. Can you please try using latest Aspose.Slides for Java 18.11 on your end and share wit us if you are still facing the issue. Please also provide the PowerPoint version you are using to reproduce the issue.
public static void AddWatermark()
{
com.aspose.slides.Presentation pres = new com.aspose.slides.Presentation();
com.aspose.slides.ISlideCollection slds = (com.aspose.slides.ISlideCollection) pres.getSlides();
IMasterSlide master=pres.getMasters().get_Item(0);
com.aspose.slides.IAutoShape ashp = master.getShapes()
.addAutoShape(com.aspose.slides.ShapeType.Rectangle,
50, 50, 500, 500);
ashp.addTextFrame("Watermark Text");
ashp.getTextFrame().getParagraphs().get_Item(0).getPortions()
.get_Item(0).getPortionFormat().getFillFormat()
.setFillType(com.aspose.slides.FillType.Solid);
ashp.getTextFrame().getParagraphs().get_Item(0).getPortions()
.get_Item(0).getPortionFormat().getFillFormat()
.getSolidFillColor().setColor(Color.GRAY);
ashp.getTextFrame().getParagraphs().get_Item(0).getPortions()
.get_Item(0).getPortionFormat().setFontHeight(25);
// Change the line color of the rectangle to White
ashp.getShapeStyle().getLineColor().setColor(Color.WHITE);
ashp.getShapeStyle().setLineStyleIndex(
com.aspose.slides.LineStyle.ThinThin);
// Remove any fill formatting in the shape
ashp.getFillFormat().setFillType(
com.aspose.slides.FillType.NoFill);
ashp.setRotation(-45);
ashp.getAutoShapeLock().setSelectLocked(true);
ashp.getAutoShapeLock().setSizeLocked(true);
ashp.getAutoShapeLock().setTextLocked(true);
ashp.getAutoShapeLock().setPositionLocked(true);
ashp.getAutoShapeLock().setGroupingLocked(true);
String path="C:\\Aspose Data\\";
pres.save(path + "SavedWatermark.pptx", com.aspose.slides.SaveFormat.Pptx);
}
I am using Aspose.Slides to make a ppt. I am using Jar aspose-slides-19.9-jdk16.jar currently for my application. But the thing is I am getting a watermark and I din’t know how to remove it. I am saving the file in the PPT format. I am attaching a file for better understanding of the issue. Is it even possible to remove this watermark.PPT.PNG (14.5 KB)
The issue that you are having is owing to missing of use of Aspose.Slides license in your application. Please visit this documentation link for your kind reference in this regard.
There 30 days trial period is for license file that you load using Jar file to use all features of API. Other than that there is no affect on Jar file. If you use the API without license, it will limit you in terms of features offered by API.
Thanks for clearing my confusion about the Jar file and the license.
Actually, we are developing a small POC, it is a web application. And in there we need to generate
PPT. Is it possible to remove watermark which I showed you few days back?? Is there any way??
We need this because if this POC get verified by client and if we get a green signal, then we can
purchase the licensed version of the api. Kindly help!!