eXist-db can generate PDFs using the XSL-FO module, which by default is configured to use Apache FOP. The idea is that if you can transform your XML into XSL-FO, then you can pass the XSL-FO to the XSL-FO module, which will then generate the PDF for you. The module's functions are documented at http://exist-db.org/exist/apps/fundocs/view.html?uri=http://exist-db.org/xquery/xslfo. This module is not enabled by default, so here's what you need to do:
Quit eXist-db if it's running.
Edit
$EXIST_HOME/extensions/local.build.properties
(or if you do not have this file, duplicate thebuild.properties
file in that directory, and rename the duplicatelocal.build.properties
) to turn the lineinclude.module.xslfo = false
toinclude.module.xslfo = true
.Rebuild eXist-db with
build.sh rebuild
(orbuild.bat rebuild
on Windows)Uncomment the XSL-FO module in conf.xml, the block beginning with
<module uri="http://exist-db.org/xquery/xslfo" class="org.exist.xquery.modules.xslfo.XSLFOModule">
Restart eXist-db
Now you can use the
xslfo:render()
function.