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

JS: Modifying 3D annot via JavaScript

Community Beginner ,
Jul 09, 2018 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​@ !

TOPICS
Acrobat SDK and JavaScript

Views

619

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

correct answers 1 Correct answer

Community Expert , Jul 14, 2018 Jul 14, 2018

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.

Votes

Translate

Translate
LEGEND ,
Jul 09, 2018 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)

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 ,
Jul 09, 2018 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

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 Beginner ,
Jul 09, 2018 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.

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 ,
Jul 10, 2018 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

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 ,
Jul 14, 2018 Jul 14, 2018

Copy link to clipboard

Copied

LATEST

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.

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 ,
Jul 10, 2018 Jul 10, 2018

Copy link to clipboard

Copied

Nobody seems to be updating the SDK documentation any more.

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