BILLmanager 5 Documentation

Documents in PDF format

To be able to print PDF documents, configure the external processor XSL-FO (XSL formatting objects). This article describes how to configure Apache FOP

Perform the following steps:

  1. Specify parameters to call the FO-processor.
  2. Upload the font.
  3. Register the font. 
  4. Restart BILLmanager. 

Parameters to call the FO-processor

Specify the parameters in the BILLmanager configuration file '/usr/local/mgr5/etc/billmgr.conf'. Add the following string:

billmgr.conf
XSLFOProc fop -c /etc/fop.conf.d/userconfig.xml -xml __xml__ -xsl __xsl__ -pdf __pdf__

The parameters between underscores  ("__xml__", "__xsl__" and  "__pdf__") will be automatically changed into directories of the corresponding files.

For example, we have the command:

/bin/sh -c fop\ -c\ /etc/fop.conf.d/userconfig.xml\ -xml\ tmp/xml.fTqNMx\ -xsl\ skins/common/xsl/report.pdf.xsl\ -pdf\ tmp/pdf.mXEPYN

"tmp/xml.fTqNMx" and  "tmp/pdf.mXEPYN" were set automatically instead of  "__xml__" and "__pdf__". 

Upload the font

Add the font file into the directory '/etc/fop.conf.d/fonts/'. 

Generate the metric file:

/etc/fop.conf.d/fonts/'
fop-ttfreader /etc/fop.conf.d/fonts/arial.ttf /etc/fop.conf.d/fonts/arial.xml
Note:
We use Arial only as an example. You may use another font.

Register the font

To register the font, use the FOP configuration file: '/etc/fop.conf.d/userconfig.xml' (add the file if it is missing ). 

The contents of the FOP configuration file where Arial is registered:

userconfig.xml'
<?xml version="1.0"?>
  <fop>
    <renderers>
      <renderer mime="application/pdf">
        <fonts>
          <font metrics-url="/etc/fop.conf.d/fonts/arial.xml" kerning="yes" embed-url="/etc/fop.conf.d/fonts/arial.ttf">
            <font-triplet name="Arial" style="normal" weight="normal"/>
            <font-triplet name="ArialMT" style="normal" weight="normal"/>
          </font>
        </fonts>
      </renderer>
    </renderers>
  </fop>

Restart BILLmanager

Execute the command to restart BILLmanager:

/usr/local/mgr5/sbin/mgrctl -m billmgr exit