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.
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++)
}
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.
Thanks,
Adobe Acrobat Team
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++);
}
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++);
}
Copy link to clipboard
Copied
Can you please try the following and see if it detects:
if (this.getAnnots3D() != undefined)
{
(i = i++);
}
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:
p3D generates this value if 3D data is present:
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.
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++)
}
Copy link to clipboard
Copied
Glad to know that your concern is resolved!