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

Free Support Forum - aspose.com

Removal of Image watermark from PDF

Hi Support Team,


I have a query regarding ASPOSE.PDF which is, do we have any functionality/method to remove image watermark from PDF. It will be also great full to you if you help me by suggesting method/functionality of removing text watermark.

Anticipating your favorable reply on this.

Thanks in Advance.

Regards,
Ravikant
Hi RaviKant,

Thanks for your inquiry. You may remove image watermark using Aspose.Pdf, please try following the instructions specified over Delete Images from the PDF File.

Moreover, there is another convenient way to delete image/text watermark with Aspose.Pdf using DeleteStampById() method but in this case watermark must be added using Aspose.Pdf API with IDs.



//Open document

Document pdfDocument11 = new Document(myDir + "PageNumber.pdf");

//Create image stamp

ImageStamp imageStamp = new ImageStamp(myDir + "aspose_pdf.jpg");

imageStamp.Background = true;

imageStamp.XIndent = 100;

imageStamp.YIndent = 100;

imageStamp.Height = 300;

imageStamp.Width = 300;

imageStamp.Rotate = Rotation.on270;

imageStamp.Opacity = 0.5;

imageStamp.setStampId(111);

//Add stamp to particular page

pdfDocument11.Pages[1].AddStamp(imageStamp);

//Save output document

pdfDocument11.Save(myDir+"output_imageStamp.pdf");

//****Removing Stamp****//

PdfContentEditor contentEditor = new PdfContentEditor();

contentEditor.BindPdf(myDir + "output_imageStamp.pdf");

StampInfo[] stampInfo = contentEditor.GetStamps(1);

//contentEditor.DeleteStampById(111);

//Loop through each stamp

for (int i = 0; i < stampInfo.Length; i++)

{

//Check to see if the ID = 111, if so delete the stamp.

if (stampInfo[i].StampId == 111)

{ contentEditor.DeleteStampById(stampInfo[i].StampId); }

}

contentEditor.Save(myDir + "output_deletedstamp.pdf");


Please feel free to contact us for any further assistance.


Best Regards,