Using the Ibex Command Line
This technical note describes how to use the Ibex command line tool. It applies to Ibex versions 6.0 and higher using .Net 6.0 or higher.
Installation
The Ibex.CommandLine package is a console application to create PDF files from the command line, for use during testing and development. The Ibex.CommandLine package is a .Net tool. This is installed from a command shell like so:
dotnet tool install -g Ibex.CommandLine
An existing installation can be updated using this command:
dotnet tool update -g Ibex.CommandLine
For more information on installation see Downloads
Executables
The Ibex.CommandLinee package installs a tool allowing you to invoke Ibex using the command "ibex".
Defaults
If an FO file is used (as opposed to an XML and XSL file) and no file extension is specified a default extension of ".fo" will be added to the input file name and a default extension of ".pdf" will be used to create the output file.
This means these two commands are equivalent:
ibex test.fo test.pdf
ibex test
Command line parameters
Option | Example | Description |
---|---|---|
-base-uri-xml uri | ibex -base-uri-xml c:\work test | specifies the base URI used when retrieving XML files and images. This defaults to the location from which the XML or FO file is loaded |
-base-uri-xsl uri | ibex -base-uri-xsl c:\work test | specifies the base URI used when retrieving XSL files. This defaults to the location from which the XSL file is loaded |
-fonts [pattern] | ibex -number arial > fonts.fo | an FO file which lists fonts with names matching the specified pattern (or all fonts if no patten is specified) is written to the standard output. This FO can the be used to create a PDF showing the correct usage of each font. This is useful for finding the correct usage when fonts have multi-word names |
-level value | ibex -level info test | specifies the logging level and must be one of "info", "warning" or "severe" |
-logfile name | ibex -logfile log.txt test | specifies the name of a file in which Ibex will log messages |
-number n | ibex -number 3 | test the creation of the PDF will be repeated the specified number of times. This is useful when looking at performance as it minimises the overhead of initialising the .Net runtime |
-pdf-version | ibex -pdf-version 1.3 test | forces the PDF version defined at the start of the PDF file to be the specified value. The default is "1.4" |
-pdfx-version value | ibex -pdfx-version "PDF/X-3:2003" test | when creating a PDF/X file this can be used to override the default value of "PDF/X-3:2003" |
-transform | ibex -transform test.xml test.xsl test.fo ibex -transform test.xml test.xsl test.fo "age=20" | this will create an FO file so you can see the results of the XLST transform. No PDF is generated. The second form shown demonstrates how to pass parameters to the XSLT transformation |
-webtimeout value | ibex -webtimeout 3000 test | this will change the timeout used when retrieving an image file from an HTTP or HTTPS server. The value specified is in milliseconds. The default value is 1300ms |
-xsl name | ibex -xsl test.xsl test.xml output.pdf | specifies the name of the XSLT stylesheet to be used to transform the XML file into FO |