3D Canvas Identification

Community Beginner ,
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.

Correct answer by JasonB81 | Community Beginner

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++)
}

 

TOPICS
Acrobat SDK and JavaScript, Create PDFs, Edit and convert PDFs, How to, Rich media and 3D, Scan documents and OCR

Views

133

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

3D Canvas Identification

Community Beginner ,
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.

Correct answer by JasonB81 | Community Beginner

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++)
}

 

TOPICS
Acrobat SDK and JavaScript, Create PDFs, Edit and convert PDFs, How to, Rich media and 3D, Scan documents and OCR

Views

134

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

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...
Aug 12, 2020 0
Community Beginner ,
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++);
}

 

 

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...
Aug 12, 2020 0
Community Beginner ,
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++);
}

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...
Aug 19, 2020 0
Adobe Employee ,
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++);
}

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...
Aug 19, 2020 1
Community Beginner ,
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.

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...
Aug 20, 2020 0
Community Beginner ,
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++)
}

 

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

Copy link to clipboard

Copied

Glad to know that your concern is resolved!

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