• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

copy from window javascript box..

Explorer ,
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

293

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
Community Expert ,
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.

Votes

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
LEGEND ,
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).

Votes

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