Please enable JavaScript to view this site.

InterFormNG Manual 2020

Instead of importing each specific, fixed image you can also refer to the images at the time of the merge, i.e. you can build up the path to image via an XPath expression. This can be used to dynamically include the image of a part in each detail line of a document.

 

The dynamic images does not even need to be placed inside {INTERFORMNG_HOME}/resources/image, as they normally need to be.

 

To use this feature you need to remember these things:

1.The image selected under the Properties tab may be blank.

2.If an image is selected under the Properties tab (together with a dynamic image as described below), then this image will be ‘fallback’, and used if the dynamic image is not found. If there is no fallback image, and the URL for the dynamic image points to a missing image, then the image element will fail with the message: ‘Error code 001003 A referenced image was not found’.

3.The URL for the dynamic image must be stated in the Source settings tab like so:

 

InterFormNG_Image_elements_003

 

4.You type the URL as the selection input above. Additional information about the URL path can be found here: https://en.wikipedia.org/wiki/File_URI_scheme. In the example above a simple text constant is used as the URL, but it could also be an XPath expression instead, e.g. using the concat to combine information from the XML file with fixed data to build up the path. If you e.g. want to refer to an image in the usual resources/images directory while running InterFormNG on IBM I, then the path can be setup as this:

concat('file:///IFormNG/InterFormNG-shell/user/resources/image/','{@ImageName}','.jpg')

 

5.The size of the dynamic image can be set in the bottom of the source settings tab above. The settings are the same as for a normal image import as described on page .

6.It is also possible to use this feature to include base64 images in the output. This image could e.g. be found in an input XML file. If you e.g. have the base64 image in the input XML file like this:

InterFormNG_Image_elements_004

 

Then we can include the image in the output in this manner:

 

InterFormNG_Image_elements_005

 

The Xpath expression above concatenates the string ‘base64://’ with the contents of the /xml node in the XML file and the string ‘.jpeg’. You need to put a valid image extension at the end, in order to make InterFormNG include the image correctly. The extension (e.g. jpeg like above) does not need to be the correct format.