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

Is there a way to check if user has a specific custom stamp installed?

Community Beginner ,
Jun 13, 2023 Jun 13, 2023

Hello All, 

Ive been wracking my brain on how to do this and I'm not even sure it's possible through Javascript.

I have a document where I want to have multiple users approve various steps with a custom stamp I've developed. I've done this with buttons coded to insert the stamps in specific locations. What I need is a way to check if the user does not currently have this stamp installed, so that instead of a blank square, it will simply insert the standard "Approved" Dynamic stamp. Something like the below...

if (*AP "customDynStamp" exists in user folder*) {//just an example of what I need
var useThisAP = "customDynStamp"
} else {
var useThisAP = "#DApproved";
}

I've tried using the app.openDoc method to check if the file exists, but I can't use the "app.getPath('app','stamps')" code to find the user's stamp file path within a button. If I create a stamp with the AP and check it afterwards, I see no difference within the properties to determine whether or not it found the image or if it's just blank.

Is this just one of those things that can't be done with code?

TOPICS
How to , JavaScript , PDF
373
Translate
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
1 ACCEPTED SOLUTION
Community Expert ,
Jun 13, 2023 Jun 13, 2023

There is actually. I got the idea from a post by Thom Parker about a similar issue. If you only specify a point (as opposed to a rect) the stamp is applied in its original dimensions. If no stamp exists that matches the AP you provided, the size will be 100x100 points. So unless your original stamp is exactly that size you can use that to find out it's missing.

View solution in original post

Translate
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 ,
Jun 13, 2023 Jun 13, 2023

There is actually. I got the idea from a post by Thom Parker about a similar issue. If you only specify a point (as opposed to a rect) the stamp is applied in its original dimensions. If no stamp exists that matches the AP you provided, the size will be 100x100 points. So unless your original stamp is exactly that size you can use that to find out it's missing.

Translate
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 ,
Jun 13, 2023 Jun 13, 2023
LATEST

Thanks for the brilliant workaround! I was about to give up on this one.

Translate
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