Create and Delete Stamp Annotation
Aspose.Pdf.Kit for Java allows you to create and delete stamp annotation with the help of PdfContentEditor and PdfAnnotationEditor classes respectively. You can use createStamp method of PdfContentEditor class to add a stamp annotation in the PDF file, while deleteAnnotation method of PdfAnnotationEditor class help you delete stamp annotation.
Aspose.Pdf.Kit for Java allows you to create and delete stamp annotation with the help of PdfContentEditor and PdfAnnotationEditor classes respectively. You can use createStamp method of PdfContentEditor class to add a stamp annotation in the PDF file, while deleteAnnotation method of PdfAnnotationEditor class help you delete stamp annotation.
This example shows you how to create and delete stamp annotation.
[Java]
//create Stamp annotation PdfContentEditor contentEditor = new PdfContentEditor(); //open PDF document contentEditor.bindPdf("input.pdf"); //define rectangle to add annotation Rectangle rect = new Rectangle(50, 50, 200, 200); //create stamp annotation contentEditor.createStamp(rect, "Stamp content", "StampName", 1); //save updated PDF file contentEditor.save("stamped.pdf"); //delete Stamp annotation PdfAnnotationEditor annEditor = new PdfAnnotationEditor(); //open PDF document annEditor .bindPdf("stamped.pdf"); //delete stamp annotation annEditor.deleteAnnotation("StampName"); //save updated PDF file contentEditor.save("output.pdf");
