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.
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.