JS: Modifying 3D annot via JavaScript

Community Beginner ,
Jul 09, 2018

Copy link to clipboard

Copied

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​@ !

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

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.

TOPICS
Acrobat SDK and JavaScript

Views

282

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

JS: Modifying 3D annot via JavaScript

Community Beginner ,
Jul 09, 2018

Copy link to clipboard

Copied

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​@ !

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

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.

TOPICS
Acrobat SDK and JavaScript

Views

283

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
Jul 09, 2018 0
Most Valuable Participant ,
Jul 09, 2018

Copy link to clipboard

Copied

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)

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
Reply
Loading...
Jul 09, 2018 2
Adobe Community Professional ,
Jul 09, 2018

Copy link to clipboard

Copied

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

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
Reply
Loading...
Jul 09, 2018 2
Community Beginner ,
Jul 09, 2018

Copy link to clipboard

Copied

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.

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
Reply
Loading...
Jul 09, 2018 0
Adobe Community Professional ,
Jul 10, 2018

Copy link to clipboard

Copied

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

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
Reply
Loading...
Jul 10, 2018 1
Most Valuable Participant ,
Jul 14, 2018

Copy link to clipboard

Copied

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.

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
Reply
Loading...
Jul 14, 2018 1
Most Valuable Participant ,
Jul 10, 2018

Copy link to clipboard

Copied

Nobody seems to be updating the SDK documentation any more.

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
Reply
Loading...
Jul 10, 2018 1