import java.awt.Color; import java.awt.geom.Rectangle2D; import java.text.DateFormat; import java.util.Date; import com.qoppa.pdf.annotations.RubberStamp; import com.qoppa.pdfProcess.PDFDocument; public class RubberStampSample { public static void main(String [] args) throws Exception { PDFDocument doc = new PDFDocument("C:/test/alphabets.pdf", null); // create a new multiline text stamp with static text and the current time String stampText = "Approved" + "\n" + DateFormat.getDateTimeInstance().format(new Date() + "\n By John Smith"); RubberStamp stamp = doc.getAnnotationFactory().createRubberStamp(stampText, Color.green); // by default the stamp is placed in the upper left corner - add some margins stamp.setRectangle(new Rectangle2D.Double(100, 100, stamp.getRectangle().getWidth(), stamp.getRectangle().getHeight())); // add the stamp to the page doc.getPage(0).addAnnotation(stamp); // save the document doc.saveDocument("c:/test/output.pdf"); } }