Configuration

All configuration of Ibex is done using the Settings class which is accessed from the ibex4.FODocument object.
This class has many properties which can be changed to configure the operation of Ibex.

Properties of the Settings class should be changed prior to calling the generate() method on the FODocument object.

The fact that the Settings object is a property of the FODocument object means that different documents can have different Settings values. For example Figure 20-1 shows how to set the default line height to 1.4em.

using System;
using ibex4;
public class IbexTester {
   public static void Main(string[] args) {
   
      FODocument doc = new FODocument()
          
      doc.Settings.LineHeightNormal = "1.4em";
           
      using( Stream xml = new FileStream( args[0], FileMode.Open, FileAccess.Read ) ) {
          using ( Stream output = new FileStream( args[1], FileMode.Create, FileAccess.Write ) ) {
                    doc.generate( xml, output );
               }
           }
   }
}

Figure 20-1: Example usage of the Settings object

Fonts

The following properties on the Settings change the way fonts a processed. By default each absolute font size (small, medium, large etc.) is 1.2 times larger than the previous size.

Property Type Default Notes
XX_Small string 7.0pt Must end in 'pt'.
X_Small string 8.3pt Must end in 'pt'.
Small string 10.0pt Must end in 'pt'.
Medium string 12.0pt Must end in 'pt'.
Large string 14.4pt Must end in 'pt'.
X_Large string 17.4pt Must end in 'pt'.
XX_Large string 20.7pt Must end in 'pt'.

Property Type Default Notes
Smaller string 0.8em Must end in 'em'.
Larger string 1.2em Must end in 'em'.

Line height

The following properties on the Settings change the default line height. Ideally Settings.LineHeightNormal should end in 'em' to make line height proportional to the font height.

Property Type Default Notes
LineHeightNormal string 1.2em

Page size

The following properties on the Settings change the default page size.

Property Type Default Notes
PageHeight string 297mm
PageWidth string 210mm

Include paths

The following properties on the Settings effect retrieving XML or XSL files.

Property Type Default Notes
BaseURI_XML string This value sets the base URI for including images and other XML files. When an fo:external-graphic element specifies a relative path, Settings.BaseURI_XML is the base URI used in accordance with the rfc2396 URI Specification . When an XML file uses an entity to include another XML file, Settings.BaseURI_XML is the base URI used when Ibex searches for the included XML file.
BaseURI_XSL string This value sets the base URI for including other XSL files. When an xsl:include element is used to include another XSL stylesheet, Settings.BaseURI_XSL can be used to specify the location the included stylesheet should be loaded from.

Images

The following properties on the Settings effect retrieving images specified using the fo:external-graphic element.

Property Type Default Notes
BaseURI_XML string This value sets the base URI for including images and other XML files. When an fo:external-graphic element specifies a relative path, Settings.BaseURI_XML is the base URI used in accordance with the rfc2396 URI Specification . When an XML file uses an entity to include another XML file, Settings.BaseURI_XML is the base URI used when Ibex searches for the included XML file.
WebRequestTimeoutMs int 300 When an fo:external-graphic element specifies an image is retrieved from a web server, this is the timeout used for the call to the web server. Units are milliseconds.

Border widths

The following properties on the Settings change the values for border widths specified with constants like 'thin'.

Property Type Default Notes
BorderWidthThin string 1pt
BorderWidthMedium string 2pt
BorderWidthThick string 3pt

Layout

The following properties on the Settings change the appearance of content in the PDF file.

Property Type Default Notes
OverflowIsVisible bool true By default a region has overflow='auto', leaving it up the Ibex to decide whether content which overflows the bottom edge of a region is displayed or discarded. If Settings.OverflowIsVisible is true, the content will be displayed, if false it will be discarded. This property applies only if the attribute 'overflow' is not set or is set to 'auto'.

Leaders

The following properties on the Settings change the values for fo:leader formatting objects.

Property Type Default Notes
LeaderDot char . When leader-pattern ='dots', this is the character used as the dot