Add the custom stamp based on the free text bounds

11 Feb 20261 minute to read

When adding a stamp programmatically, the PDF Viewer expects offset values in points (1 point = 1/72 inch). Typical displays use 96 DPI for pixels, so convert pixels to points using: points = pixels * 72 / 96. Also consider page scale and rotation when positioning stamps so the stamp appears at the expected location on the page.

Here is an example of how you can add the custom stamp based on the free text bounds:

  public annotationAdd(args) {
    if (args.annotationType === 'FreeText') {
      this.x = (args.annotationBound.left * 72) / 96;
      this.y = (args.annotationBound.top * 72) / 96;
      console.log(args);
    }
  }

Find the sample how to add the custom stamp based on the free text bounds.