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

Free Support Forum - aspose.com

Watermark added using Watermark artifact for page containing images is not displayed properly

watermark gets hidden by the images added on the PDF page.


Please share a sample PDF file along with the complete sample code snippet that you are using to add the watermark. We will test the scenario in our environment and address it accordingly.

Thanks for quick response.

Here is the code I am trying -
I have attached the input as well as output pdfs , let me know if I am missing something.Demo2.pdf (303.4 KB)
watermark_text.pdf (304.2 KB)

public static void addWatermark() {

	// Open document
	Document doc = new Document(_dataDir + "Demo2.pdf");
	FormattedText formattedText = new FormattedText("Watermark", java.awt.Color.BLUE, FontStyle.Courier,
			EncodingType.Identity_h, true, 72.0F);
	for(int i=1; i<=doc.getPages().size(); i++) {
		WatermarkArtifact artifact = new WatermarkArtifact();
		Point waterMarkPos = new Point(200,200);
	doc.save(_dataDir + "watermark_text.pdf");


You are noticing this behavior because you are setting the watermark in the background. Please use setBackground(false) to render it correctly.


watermark_text.pdf (304.5 KB)

@asad.ali this resolved my issue.

Thank you.

1 Like