Dashboard > Avoka Public > ... > Business Process Techniques and Patterns > How to Insert an Image into a Form
How to Insert an Image into a Form Log In   View a printable version of the current page.
Added by Kendy Yus , last edited by David Glen on Oct 18, 2007  (view change)
Labels: 
(None)

Please click here for full reference on Image Inserter DSC.

Using Avoka Image Inserter DSC

Scenario

Previously when displaying images in forms using Reader Extensions 7.x up until 8.0, we can use a URL to specify the image URL dynamically, and the image will be loaded when the form is opened. However, since the release of Reader Extensions 8.1, the feature of specifying image URL has been removed due to security concerns.

One of the possible solutions is to embed the image to the form when designing the form, but in this way, we will not be able to dynamically determine what image is to be displayed according to the value of particular form field.

Avoka Image Inserter allows you to insert the image to an XML dynamically by doing the image lookup based on the image URL specified in an XML field, apply encoding to the image content, and then insert it back to a specified XML field to be displayed. This XML is then merged to a Form variable where there is an Image Field (NOT Image) bound the XML field containing the encoded image. 

The original extracted XML data from the Form might look like this:

<imageType>
	<image>http://test-lces:8080/images/MyPicture.jpg</image>
	<imageContent/>
</imageType>

We need the XML to look like the following, in order for the Form binding to work correctly so that the image can be displayed on the Form:

<imageType>
	<image>http://test-lces:8080/images/London.jpg</image>
	<imageContent>/9j/4AAQSkZJRgABAQAAAQABAAD//g ... D5T/2Q==</imageContent>
</imageType>


The Image Inserter Service

This is developed by Avoka Technologies, containing an operation, called "Insert Image", that does the following:

1. Reads in a specified XML field value from an XML, which contains the image URL.

2. Downloads the image from the URL.

3. Performs encoding to the downloaded image

4. Inserts the encoded content to the specified field of the XML.

To obtain an evaluation copy of the Image Inserter Service, go to the Avoka Website: http://www.avoka.com and follow the links.
The Image Inserter DSC, once installed, will appear as a new service under the category Avoka in your LiveCycle WorkBench.


 

The Process



As shown in the figure above, the step that we are interested in is the second step that does the image insertion to an XML, then the XML data is merged into a Form to be reviewed by a User step. In most cases, you will have the XML data extracted from a submitted form instead of having the first step shown there to initialize an XML variable.

For demonstration purposes, we have provided the exported sample process, form and its schema for the process described above, as an attachment to this article. You can import it as a process to your LiveCycle ES via workbench, for guidance in setting up property values for Insert Image operation steps.

Setting Properties for "Insert Image" Operation



 
To configure the properties of the "Insert Image" operation step, click on that step, then click on the "Properties" view on your Workbench. It will show a dialog box as seen above.

You will need to specify the XML field, which will contain the image URL via XPath Expression as well as the XML field to write the encoded image content to via XPath Expression.

Setting Properties for "Set Value" Operation to Merge XML data to Form


Powered by Atlassian Confluence 2.7.2, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators