Copy link to clipboard
Copied
Hello everybody,
I have a small javascript custom tool button that shows me the trim size of the pdf page.
Is this possible to copy the mesage alert (or if there is another type of window box) on clipboard after the window appears ?
Thank you.
function TrimSize(){
var aRect = this.getPageBox("Trim");
var width = aRect[2] - aRect[0];
var height = aRect[1] - aRect[3];
var rw =(width*0.3528).toFixed(1);
var rh = (height*0.3528).toFixed(1);
//___________________________________________
app.alert("Trim: " + rw + " mm x "+ rh + " mm"
);
}
app.addToolButton({
cName: "Trim Size",
cLabel: "Trim Size",
cExec: "TrimSize()",
cTooltext: "Trim Size",
nPos: 0
});
Copy link to clipboard
Copied
No. JS in Acrobat can't copy text to the clipboard, or paste from it.
Copy link to clipboard
Copied
The clipboard is outside JavaScript's sandbox (because it can affect other apps).