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

Make onclick action by javascript after clicking on 3d

New Here ,
Feb 08, 2020 Feb 08, 2020

Copy link to clipboard

Copied

Hi everyone. 

I use Adobe Acrobat XI Pro.

I have some idea, but i really don't have enough knowledge to realize it.

I insert 3d model (*.u3d) in pdf file,after than i try to make onclick action which open alert or annotation with some inforamtion about this object.

 

SC.jpg

Have anyone any example in javascript how to realize it ?

I found in api some examples to show alert by clicking on text or link, but nothing about clicking on 3d.

Views

909

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 ,
Feb 08, 2020 Feb 08, 2020

Copy link to clipboard

Copied

initialize a variable (to zero) and increment it and test if it's 3 in your click listener function.

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
New Here ,
Feb 08, 2020 Feb 08, 2020

Copy link to clipboard

Copied

LATEST

Ok. Tank you for you opinion, but i really don't understand how to apply your advice because i am not programmer(((

I have one example which most suitable for my task. But it applicable for the "word"

It search "word" and set some action. I need something like this but with 3d body geometry.

This is my example from api Adobe:

 

for (var p = 0; p < this.numPages; p++){
var numWords = this.getPageNumWords(p); for (var i=0; i<numWords; i++)
{
var ckWord = this.getPageNthWord(p, i, true); if ( ckWord == "Acrobat")
{
var q = this.getPageNthWordQuads(p, i);
// Convert quads in default user space to rotated // User space used by Links.
m = (new Matrix2D).fromRotated(this,p);
mInv = m.invert()
r = mInv.transform(q)
r=r.toString()
r = r.split(",");
l = addLink(p, [r[4], r[5], r[2], r[3]]);
l.borderColor = color.red
l.borderWidth = 1
l.setAction("this.getURL('http://www.adobe.com/');
}
}
}

So, as you understand i want to redo this string into another:

"var ckWord = this.getPageNthWord(p, i, true); if ( ckWord == "Acrobat")
{"

i want to force Java search not a word but geometry. For example "Geometry 1"

By name or by Id. It does not matter.

 

Further as you guess i need to set onclik action one the "Geometry 1" that we found

 

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
Community Expert ,
Feb 08, 2020 Feb 08, 2020

Copy link to clipboard

Copied

Please post the name of the Adobe program you use so a Moderator may move this message to that forum

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