如何检查用户是否安装了特定的自定义图章?

huangapple go评论92阅读模式
英文:

How can I check if user has a specific custom stamp installed?

问题

Sure, here's the translated part:

我有一个文件,我希望多个用户可以使用我开发的自定义图章来批准各种步骤。我已经通过编写按钮来在特定位置插入图章来实现这一点。我需要的是一种方法来检查用户当前是否已安装了这个图章,以便在插入标准的“已批准”动态图章时,不会出现空白方框。类似于以下内容...

if (*AP "customDynStamp" 存在于用户文件夹中*) {
useThisAP = "customDynStamp";
} else {
useThisAP = "#DApproved";
}

var annot = this.addAnnot({
page: 0, type: "Stamp", name: "FinApproval", rect: [356, 200, 453, 245],
AP: useThisAP });
var f = getField("Approval button")
f.display = display.hidden

我尝试使用app.openDoc方法来检查文件是否存在,但我无法在按钮内使用app.getPath('app','stamps')代码来找到用户的图章文件路径。如果我创建一个具有AP的图章并之后进行检查,我无法在属性中看到任何区别,以确定它是否找到了图像或者只是空白。

英文:

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*) {
useThisAP = "customDynStamp"
} else {
useThisAP = "#DApproved";
}

var annot = this.addAnnot({
page: 0, type: "Stamp", name: "FinApproval",  rect: [356, 200, 453, 245],
AP: useThisAP });
var f = getField("Approval button")
f.display = display.hidden

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.

答案1

得分: 0

"如果有人遇到类似问题,Adobe论坛上的Try67能够找到一种检查的方法。\n\n"如果你只指定一个点(而不是一个矩形),印章将以其原始尺寸应用。如果没有与你提供的AP匹配的印章,尺寸将为100x100点。因此,除非你的原始印章恰好是这个尺寸,否则你可以用它来找出它是否丢失。"

英文:

For anyone who's having a similar issue, Try67 on the adobe forums was able to find a method to check.
"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 provide, 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."

huangapple
  • 本文由 发表于 2023年6月8日 02:24:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/76426109.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定