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.
- Connect to the server with the platform via SSH.
Specify the parameters for calling the FO processor. Add the following line to the BILLmanager configuration file — /usr/local/mgr5/etc/billmgr.conf:
billmgr.conf
XSLFOProc fop -c /etc/fop.conf.d/userconfig.xml -xml __xml__ -xsl __xsl__ -pdf __pdf__
CODEParameters in double underscores ("__xml__", "__xsl__" and "__pdf__") will automatically be replaced with the directories of the corresponding files.
Click here to expand...For example, the command to be executed:
/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
CODEIn the string, the parameters "__xml__" and "__pdf__" were automatically replaced with the values tmp/xml.fTqNMx and tmp/pdf.mXEPYN, respectively.
Upload the font file into the /etc/fop.conf.d/fonts/fonts/ directory.
The font used for the example is Arial.
Once the file is posted, generate the metrics file:
/etc/fop.conf.d/fonts/
fop-ttfreader /etc/fop.conf.d/fonts/arial.ttf /etc/fop.conf.d/fonts/arial.xml
CODERegister the font you are using. The FOP configuration file is used to register fonts: /etc/fop.conf.d/userconfig.xml. If such a file does not exist, create it manually.
The contents of the FOP configuration file in which the Arial font 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>
XML- Restart BILLmanager:
/usr/local/mgr5/sbin/mgrctl -m billmgr exit
DELPHI