Using XML Configuration Files (*.xml)

FSI Viewer uses XML configuration files which can easily be edited with any text editor.

The default configuration file "_default.xml" - which is located in /fsi/web/viewer/ is the most important XML configuration file and will always be evaluated first.

To use FSI Viewer with additional configuration files you have to place the file in the /fsi/web/viewer/config/ folder and provide the name of the configuration file using the "cfg" parameter in the code:

Using FSI Viewer Configuration Files
//adding the fsiviewer.js script
<script src="js/fsiviewer.js" type="text/javascript"></script>
//Example with using a FSI Viewer configuration file:
<fsi-viewer width="500" height="600"
src="/images/sample.jpg" cfg="sample_configuration">

This will load the /fsi/web/viewer/config/sample_configuration.xml file as the FSI Viewer JS configuration.

Configuration files are structured into configuration groups (XML nodes) containing parameter names and values. Only parameters in these groups will be recognized by FSI Viewer. Configuration files do not need to contain all groups though. Each parameter has to be provided as an individual XML child node of a group where the node name is the parameter name and the parameter value needs to be provided as "value" attribute of the node.


It is possible to implement viewer parameters in the XML configuration using specific viewer nodes, e.g.

  • <Viewer>
  • <TouchZoom>
  • <QuickZoom>
  • <Pages>
  • <Thumbbar>

This enables you for example to implement globally used FSI Viewer, FSI TouchZoom, FSI Pages, FSI ThumbBar or FSI QuickZoom parameters in the _default.xml or for certain viewers with an individual configuration .xml file.

Structure of XML configuration files
     	<parameter value="" />

 		<parameter value="" />

    	<parameter value="" />
    	<parameter value="" />

Simple Configuration File
     <path value="samples/Watch.jpg" />
     <skin value="silver" />
     <debug value="1" />
	 <noNav value="true" />
	  <useDevicePixelRatio value="true" />
	  <enableByCSSClass value="zoom-image" />
	  <zoomPrecision value="3" />

 Please keep in mind the following rules when using XML configuration files:

  • Attribute values must be provided in double quotes
  • The last occurrence of a given parameter will be used
  • Configuration files might be cached by your browser, so that changes in these files require flushing the browser cache. This does not apply when using the debug mode.
  • Make sure to save configuration files in UTF-8 format if your configuration file contains language specific diacritics, Japanese characters and alike 

You can comment on or disable sections of an XML configuration file using the usual XML comment syntax:

  <!—- This is a comment -->
  <path value="image.tif" />
  <!-- The following section will be ignored -->
  <path value="anotherimage.tif" />