To install queXML where you can locally do stylesheet conversions (such as producing a PDF file), you will need to follow the steps below.
A service to use queXML online (instead of installing locally) is available from the Australian Consortium for Social and Political Research Incorporated - called queXML tools. If you use this service, you will only require a queXML document and the web service will do the stylesheet conversion for you.
New in queXML 1.3.0: queXMLPDF class in PHP
The queXMLPDF class is written in PHP and requires both a PHP environment and TCPDF to run. I have tested the queXMLPDF class with TCPDF version 5.8.008.
If you don't want to install it locally, you can test this class on the queXML tools website
To install and test this class:
- Download and extract queXML >= 1.3.0 on your webserver that runs PHP
- Download and extract TCPDF >= 5.8.008
- Edit the quexmlpdf.php file and point the first two include lines to your TCPDF files
- Give it a test run by running quexmlpdf_example.php by pointing to it in your web browser
Installing queXML tools locally
- If not already installed, download and install Java
- Download and extract Apache FOP 0.94
- Download and extract barcode4j 2.0 inside the fop-0.94 directory
- download and extract queXML-1.1.0 inside the fop-0.94 directory
- edit the fop.bat file (or fop file if using *nix) to add the barcode4j classpath
- eg: add the following lines where setting the classpath:
- set LOCALCLASSPATH=%LOCALCLASSPATH%;%LOCAL_FOP_HOME%barcode4j-2.0\build\barcode4j.jar
- set LOCALCLASSPATH=%LOCALCLASSPATH%;%LOCAL_FOP_HOME%barcode4j-2.0\build\barcode4j-fop-ext.jar
- Run fop
- example command (please note that parameters are case-sensitive):
- fop -xml quexml-1.1.0\test_questionnaire.xml -xsl quexml-1.1.0\to_form.xslt -pdf test.pdf -param questionnaireId 5 -param show_cover_page false
- this command does the following:
- Runs FOP
- Passes test_questionnaire.xml as the queXML file
- Passes to_form.xslt as the stylesheet
- Creates a PDF file called test.pdf
- Passes the parameter: questionnaireId = 5 to queXML
- Passes the parameter: show_cover_page = false to queXML