Load image on stamp by script
- April 12, 2020
- 1 reply
- 2056 views
Hello.
I'm creating a stamp. The stamp directly shows a form to collect some user data text. In addition, I want that stamp has a image (it's a signature scanned) of the user. I was triying to do in several ways:
1) Set a image field, that directly loads an image preestablished in the folder user, trying to establish it with this code ( unsuccessfully) that I got form issue https://adobe.ly/2XuHQM4
trustedImport = app.trustedFunction(function(doc)
{
app.beginPriv();
var f = doc.getField("Image8");
f.buttonImportIcon("C:\Users\cesar\AppData\Roaming\Adobe\Acrobat\2017\Stamps\beard.png");
app.endPriv();
});
trustedImport(this);The I get Error:
NotAllowedError: Security settings prevent access to this property or method.
App.trustedFunction:278:Field Text5:Calculate
2) Set a image field, but allowing the user to chose the image from a browser. For this I need a button on the form, that opens a browser and chooes the image and the set in to the image field. Tryigin to discover a code that makes that action, I saw some code on forums. It's probably bad code, but I think you can take the idea I want.
var dlg = new Window('dialog','onClick test');
dlg.But1 = dlg.add('button',undefined,'Click Me');
dlg.But1.onClick = event.target.buttonImportIcon();
dlg.show();
Error:
ReferenceError: Window is not defined
281:Field:Calculate
