Q: How can I create an image field that let’s you browse to an image or a pictures and insert it into a PDF document?

A: Starting in PDF Studio 12, you can add an Image Fields by going to Forms

Note: In order for this to work the user’s application must support JavaScript functionality in PDFs (all major competitors i.e. Adobe reader, etc… support JavaScript). This is true for any image button created by any PDF editor. Special functionality such as buttons with actions need JavaScript to run, so if the user opens the document in an application that does not support JavaScript (or has it disabled in preferences) the button will not work.

Click Image Button on toolbar and place it on the document

In PDF Studio 11 and below:

You can use a JavaScript function on a button to allow users to click and browse to an image and add it to the PDF Document.

Note: Starting in PDF Studio 10, additional formats (PNG, TIFF, GIF) were added but in earlier versions only JPEG images could be imported.

To add an image field button to your PDF document (using PDF Studio), follow the instructions below.

Creating an Image Import Button

  1. Open the form that you wish to add the image import button
  2. On the menu bar select Forms->Create/Edit FormCreate.Edit form menu
  3. This will open up the Form Field Toolbar
  4. Click on the Push Button icon located on the tool barCreate a Button
  5. Once you click on the button you can place the Push Button wherever you need it on the PDF document
  6. Use the black dots on the corners and edges to resize the shape of the box so that it fits the area that you neededit Button
  7. Once you have completed placing the Push Button you will need to set the action for the push button using the properties menu
    • To open the Push Button’s properties menu either double click on the Push Button or right click and select properties.Push Button properties
    • Click on the Options tab and enable the button image by selecting any of the formatting options from the Image drop down menu. (Center usually works best) Image Select Options
    • Click on the Actions tab. Then click on the Add button to open up the actions menu. Set the Action as JavaScript Action then in the field below enter the following event.target.buttonImportIcon() 
    • Then click OK and OK again to close the button properties
  8. Repeat steps 1-7 to create as many Image Push Buttons as you need.
  9. Once complete click on the Stop Form Editing button on the toolbar to close the form editor and then save the document
  10. Your document is now ready to use and distribute to other users.

 

Note: This function is supported by most other PDF viewers, including the newer versions of Adobe Reader DC. Previous versions of Adobe only supported their own format known as XFA that can only be created using Adobe LiveCycle Form Designer.