How to remove the watermark in PDF

Hi,

We are using the Aspose pdf.kit (java) for adding the watermark into the existing pdf documents. we are adding the watermark into pdf at one state and need to remove the added watermark in another state. I'm getting the issues with the removing the waternark. Can you please provide the sample code for removing the watermark.

The following code is used for the adding the watermark in pdf .

PdfFileStamp fileStamp1 = new PdfFileStamp(outFile, stampFile);
Stamp logoStamp = new Stamp();
logoStamp.bindLogo(new FormattedText("Submitted",
new FontColor(90,90,90), FontStyle.TimesRoman, EncodingType.Winansi, false, 50));
logoStamp.setOrigin(200, 400);
logoStamp.isBackground(true);
logoStamp.setOpacity(0.5f);

logoStamp.setRotation(30);

fileStamp1.addStamp(logoStamp);
fileStamp1.close();

Stamped file also attached.

Regards,

Dheeraj

Hi Dheeraj,

I’m sorry to share with you that Aspose.Pdf.Kit currently doesn’t allow you to remove watermark; however, we have logged a related feature request as PDFKITJAVA-21300 in our issue tracking system. You’ll be notified via this forum thread once it is supported.

Nevertheless, in the meanwhile, you may try a workaround by replacing an existing watermark text by an empty string i.e. string “Submitted”, in the above scenario, can be replaced with string “”. However, I’m afraid, this might not work in all scenarios, but you may try this for your particular cases.

We’re sorry for the inconvenience. If you have any further questions or concerns, please do let us know.
Regards,