[]
        
(Showing Draft Content)

Stamp Annotation

A stamp annotation displays graphics, images, or text on a page to resemble a stamped mark. When opened, the annotation displays a pop-up window containing the associated note.

Stamp-Annotation.png

Use the StampAnnotation class to add stamp annotations to a PDF document.

const doc = new PdfDocument();
const page = doc.newPage();

// Create an instance of StampAnnotation class and set its relevant properties
const stamp = new StampAnnotation();
stamp.contents = "This is a sample stamp";
stamp.userName = "Jamie Smith";
stamp.color = "SkyBlue";
stamp.icon = "Confidential";
stamp.creationDate = Date.now();
stamp.rect = { x: 100.5, y: 110.5, width: 72, height: 72 };

page.annotations.add(stamp); //Add the stamp annotation

const docData = doc.savePdf();
Util.saveFile("StampAnnotation.pdf", docData);