PDF Automation Station

PDF Automation Station

Positioning PDF Stamps Programmatically Part II

Not as easy as it looks

David Dagley's avatar
David Dagley
Jun 28, 2025
∙ Paid
Share
a wall with pictures on it
Photo by Tolga deniz Aran on Unsplash

In last week’s article I provided scripts to run in the console that placed the built-in Reviewed dynamic stamp in all four corners of the page.

Share


Positioning PDF Stamps Programatically Part I

Positioning PDF Stamps Programatically Part I

David Dagley
·
Jun 21
Read full story

The scripts used the height and width of the stamp.

Calculating Stamp Height and Width

  • To calculate the height of a stamp, simply subtract the bottom rect [1] from the top [3].

  • To calculate the width of a stamp, simply subtract the left rect [0] from the right [2].

  • First, apply a stamp to a page and then select the stamp. Use the Reviewed dynamic stamp for this example.

  • Run the following script in the console:

var rc=this.selectedAnnots[0].rect;
var height=rc[3]-rc[1];
var width=rc[2]-rc[0];
console.println("The height of the stamp is "+height+ "points.\rThe width of the stamp is "+width+" points.");

The script above should return the following two lines:

The height of the stamp is 55.1083984375points.
The width of the stamp is 255.63818359375 points.

For simplicity, and without negatively affecting the results, these numbers can be rounded to 55.11 and 255.64.

Get the course above, and a suite of automation tools for FREE with a Professional subscription.

This post is for paid subscribers

Already a paid subscriber? Sign in
© 2025 David Dagley
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture