Estoy creando un formulario PDF con adobe reader. Agregué un campo de imagen y un cuadro de texto. El cuadro de texto es de solo lectura y quiero completar el cuadro de texto con la ruta de la imagen seleccionada por el usuario final, en el campo de la imagen. El siguiente es mi código:
var one = this.getField("Image1");
var two = this.getField("Text1");
two.value='The Path';
El código anterior se ejecuta normalmente, pero no puedo averiguar qué escribir en lugar de 'La ruta' , para obtener la ruta real de la imagen seleccionada por el usuario final.
En el botón Image1 hay 2 acciones:
Ratón arriba (ejecutar Js)
event.target.buttonImportIcon();
On Blur (ejecutar Js)
var one = this.getField("Image1"); var two = this.getField("Text1"); two.value='The Path';
Si entiendo su solicitud correctamente ... Suponiendo que Image1 es un campo de botón y Text1 es un campo de texto y desea que el archivo de imagen seleccionado aparezca como el icono del botón, el código sería el siguiente ...
var one = this.getField("Image1");
var two = this.getField("Text1");
var doc = app.browseForDoc(); // Allows the user to browse for a file
var docPath = doc.cPath; // gets the file path of the selected file
one.buttonImportIcon(docPath); // uses the selected path to import the image as the "normal" or "up" button icon
two.value = docPath; // set the value of the text field to the selected device independent path
Este artículo se recopila de Internet, indique la fuente cuando se vuelva a imprimir.
En caso de infracción, por favor [email protected] Eliminar
Déjame decir algunas palabras