These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Is there a FORM FIELD that I can drag a JPEG into?

thebossone
Registered: Mar 20 2008
Posts: 2

Hi Experts,

I created a name badge template for a company using Illustrator. I saved the image as a PDF and created form fields on it for employee name, position, etc., with Acrobat Professional 8. It works great and the company's HR person can add the required info using her standard Acrobat Reader program. BUT, there is also a place on the name badge that a picture of the employee is supposed to go. I am hoping to find a way to create a form field on the PDF that I can drag a small JPEG of the employee's head into. Right now the HR lady is having to cut out a picture of the employee and glue it to the printed-out name badge before laminating it. It would be awesome if I could create the PDF so that the HR lady could drag employee pictures right into a form field on the PDF so that the picture could be printed off with the rest of the name tag and form fields containing the employee's name, position, etc. But I can't find a form field that will accept an image file. Can you help???

Thanks!

Bryan

My Product Information:
Acrobat Pro 8.0, Macintosh
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You can't do the drag and drop bit, but you can add a field to a PDF that will load and display an image. Unfortunately, the code for this will not work in Reader 8. Although it will work in previous versions of Reader.

Here's the method:

Add a Button Field to the form.
In the Option tab in the Properties dialog for the button set it to IconOnly

Add this code the to button up event -

this.importIcon("MyIcon");
var ic = this.getIcon("MyIcon");
event.target.buttonSetIcon(ic);


Another method is to use the "image" control in a LiveCycle Form. But you'll need the Window's version of Acrobat to make one of these kinds of forms. Once it's made it should work in Reader on the Mac.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

luckylou
Registered: Feb 5 2007
Posts: 18
This is an interesting workaround, but it's not really putting an image in a field, it's using an image as the icon of the button. The problem is when you want to enter field data for more than one record, the fields all clear but the button retains its image. You need to specifically clear the button's icon image somehow. What's the best way to do it without going through the button's Properties?
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The button is a form field type, so in fact, it is putting an image on a field. The button is the only field type that supports displaying an image. An image is not proper field data, it's part of the appearance, so the form reset does not affect it.

There is no direct way to clear a button image from a script. There is no "buttonClearIcon" function. It'd be nice if there were. This can only be done indirectly. For example, changing the "buttonPosition" property to "textOnly", or setting the image to a transparent gif, or an empty image.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

chooker
Registered: Jan 16 2009
Posts: 2
Following this same need, is there a way to set a script on the button that prompts the user for a graphic file, that when they select will load as the Icon image.

This would allow a form, such as the employee ID to be used by the person making up the badge to select the image of the employee when preparing the ID.

Since there is a way to select a graphic image to be used for a button, I would think you could do this with a Java Script?
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Why yes, see the second post. However, different versions of Adobe Reader will treat this code differently. It works in some and it doesn't in others.

Do a search for "Button Image" on this forum and other Acrobat/PDF forums and you'll find many discussions on this very topic going back years.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

chooker
Registered: Jan 16 2009
Posts: 2
Correct answer, worked like a charm! Thank You.