copy from window javascript box..

Community Beginner ,
Jan 20, 2021 Jan 20, 2021

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
	
});

 

TOPICS
Acrobat SDK and JavaScript

Views

57

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Most Valuable Participant ,
Jan 20, 2021 Jan 20, 2021

Copy link to clipboard

Copied

No. JS in Acrobat can't copy text to the clipboard, or paste from it.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Most Valuable Participant ,
Jan 20, 2021 Jan 20, 2021

Copy link to clipboard

Copied

LATEST

The clipboard is outside JavaScript's sandbox (because it can affect other apps).

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines