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

3D Canvas Identification

Community Beginner ,
Aug 11, 2020 Aug 11, 2020

Copy link to clipboard

Copied

I have a PDF generated off site by a 3rd party developer, that contains an embedded 3D model window. I have developed a Javascript that applies a "Preliminary" stamp across the face of each sheet. This stamp interferes with  the model interaction, so I would like to leave the stamp off or modify the stamp in someway if the window is present. The problem is we do not know ahead of time what sheet this window will be on. I am looking for a way to “scan” the page for this 3D canvas window. If I can find a way to identify this I could use an IF statement to skip this sheet when applying the stamps. The problem is I don’t see any unique identifier for this type of object. I am currently using Acrobat DC Pro.

TOPICS
Acrobat SDK and JavaScript

Views

488

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 Beginner , Aug 20, 2020 Aug 20, 2020

I must have mistyped something earlier, I just got this code to work. It increments through each sheet looking for the  3D window and if it finds it just increments to the next "i" value without the stamp. Thank you girijaAgarwal your post got me moving in the right direction. I may change this later to shrink the stamp so it is not over the window but this code did the trick. 


for(i = 0; i < tP; i++) {
var p3D = this.getAnnots3D(i);
if (p3D != "")
{
(i++)
}

 

Votes

Translate

Translate
Adobe Employee ,
Aug 12, 2020 Aug 12, 2020

Copy link to clipboard

Copied

Hi JasonB81,

 

Thanks for reaching out to us. As far as we understand the concern, you could use the api getAnnots3D documented here to detect the 3D canvas https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/js_api_reference.pdf.

Please let us know if this helps.

image (5).png

Thanks,

Adobe Acrobat Team

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 ,
Aug 12, 2020 Aug 12, 2020

Copy link to clipboard

Copied

I tried placing this IF stament in my script that is looping through the pages applying the stamps, but I am still getting the stamp. My thought was if Annots3D has been activated on the sheet it will skip to the next sheet. ("i" is used to specify page number.)

 

if (this.getAnnots3D.activated = true) {
(i = i++);
}

 

 

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 ,
Aug 19, 2020 Aug 19, 2020

Copy link to clipboard

Copied

I still have not figured this out, any help would be appreciated.

 

I tried placing this IF stament in my script that is looping through the pages applying the stamps, but I am still getting the stamp. My thought was if Annots3D has been activated on the sheet it will skip to the next sheet. ("i" is used to specify page number.)

Non-working looped code was:

 

if (this.getAnnots3D.activated = true) {
(i = i++);
}

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
Adobe Employee ,
Aug 19, 2020 Aug 19, 2020

Copy link to clipboard

Copied

Can you please try the following and see if it detects:

 

if (this.getAnnots3D() != undefined)

{
(i = i++);
}

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 ,
Aug 20, 2020 Aug 20, 2020

Copy link to clipboard

Copied

I could not get your method to work for me, but I have added this code to my loop and noticed a difference on the slides that contains the 3D data.

 

var p3D = this.getAnnots3D(i);
app.alert(p3D,3);

p3D generates an empty value if no 3D data is present:

this is a slide with no 3D datathis is a slide with no 3D data

 

p3D generates this value if 3D data is present:

this is a slide with 3D datathis is a slide with 3D data

 

I tried the obvious

 

if (p3D != " ")

{
(i = i++);
}

 

this didnt work, so I am going through trying to possibly create a boolean variable from this but havent got it to work yet.

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 ,
Aug 20, 2020 Aug 20, 2020

Copy link to clipboard

Copied

I must have mistyped something earlier, I just got this code to work. It increments through each sheet looking for the  3D window and if it finds it just increments to the next "i" value without the stamp. Thank you girijaAgarwal your post got me moving in the right direction. I may change this later to shrink the stamp so it is not over the window but this code did the trick. 


for(i = 0; i < tP; i++) {
var p3D = this.getAnnots3D(i);
if (p3D != "")
{
(i++)
}

 

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
Adobe Employee ,
Aug 20, 2020 Aug 20, 2020

Copy link to clipboard

Copied

LATEST

Glad to know that your concern is resolved!

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