Skip to main content
Participant
July 9, 2018
Answered

JS: Modifying 3D annot via JavaScript

  • July 9, 2018
  • 3 replies
  • 970 views

Hi. I am a beginner in the JavaScript SDK of Acrobat.

I would like to change the size of the 3D annot but it seems the following piece of code is not working.

var pageIndex = this.pageNum;  

var annotIndex = 0;  

var aMy3DAnnots = this.getAnnots3D(pageIndex);  

var RectArray = aMy3DAnnots[annotIndex].rect;  

RectArray = [48, 200, 300, 193];

For fields, I have a similar piece of code and it works.

aObj = this.getAnnots({nPage:0});

aObj[0].rect = [48,100,300,193];

Is there anything that I am doing wrong?

Thank you very much for your guidance. Acrobat SDK​@ !

This topic has been closed for replies.
Correct answer try67

The same applies for a RichMedia Annotation, by the way. The rect property is supposedly R/W, but changing its value doesn't affect the actual annotation.

3 replies

Legend
July 10, 2018

Nobody seems to be updating the SDK documentation any more.

BarlaeDC
Community Expert
Community Expert
July 9, 2018

HI,

Although the property is marked as read/write in the documentation, changing it appears to have no effect on the 3D annot itself, where as changing it for a rect annotation, has the required effect.

This looks like either a bug in the documentation, the property should be read only, or a bug in Acrobat, the rect should be changable but isn't.

I can't think of any other way of changing the location using scripting.

We could probably create a plugin using the Acrobat SDK that would be able to move the annotation, not sure if that would be an option, but wanted to include for your information

Regards

Malcolm

Participant
July 10, 2018

So it seems like it a flaw in the documentation.

Will someone fix the documentation as soon as possible so other users who are reading the SDK documentation don't have the same issue in the future?

Creating plugin won't be an option.

BarlaeDC
Community Expert
Community Expert
July 10, 2018

Hi,

Well we don't know if it is issue with the documentation or with Acrobat JavaScript, it could be supposed to work and not.

There doesn't appear to be a way to log a bug against the Acrobat SDK, the form for feature request/bugs only has the main products listed. Feature Request/Bug Report Form

Regards

Malcolm

Legend
July 9, 2018

Your code does nothing. It copies a rectangle to RectArray and changes the copy. You do nothing to affect the annotation, which the other example does do. (I know nothing about 3D annotations so I don’t know if there is a solution)